Skip to content

Commit

Permalink
update image for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
figassis committed Nov 29, 2024
1 parent 6f90a92 commit 01e8734
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
12 changes: 1 addition & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
FROM alpine:latest as rclone

# Get rclone executable
ADD https://downloads.rclone.org/rclone-current-linux-amd64.zip /
RUN unzip rclone-current-linux-amd64.zip && mv rclone-*-linux-amd64/rclone /bin/rclone && chmod +x /bin/rclone

FROM restic/restic:0.11.0

RUN apk add --update --no-cache heirloom-mailx fuse curl

COPY --from=rclone /bin/rclone /bin/rclone
FROM restic/restic:0.17.3

RUN \
mkdir -p /mnt/restic /var/spool/cron/crontabs /var/log; \
Expand Down
23 changes: 1 addition & 22 deletions backup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

VERSION=0.0.1
VERSION=0.0.2
lastLogfile="/var/log/backup-last.log"
lastMailLogfile="/var/log/mail-last.log"
lastMicrosoftTeamsLogfile="/var/log/microsoft-teams-last.log"
Expand Down Expand Up @@ -68,27 +68,6 @@ fi
end=`date +%s`
echo "Finished Backup at $(date +"%Y-%m-%d %H:%M:%S") after $((end-start)) seconds"

if [ -n "${TEAMS_WEBHOOK_URL}" ]; then
teamsTitle="Restic Last Backup Log"
teamsMessage=$( cat ${lastLogfile} | sed 's/"/\"/g' | sed "s/'/\'/g" | sed ':a;N;$!ba;s/\n/\n\n/g' )
teamsReqBody="{\"title\": \"${teamsTitle}\", \"text\": \"${teamsMessage}\" }"
sh -c "curl -H 'Content-Type: application/json' -d '${teamsReqBody}' '${TEAMS_WEBHOOK_URL}' > ${lastMicrosoftTeamsLogfile} 2>&1"
if [ $? == 0 ]; then
echo "Microsoft Teams notification successfully sent."
else
echo "Sending Microsoft Teams notification FAILED. Check ${lastMicrosoftTeamsLogfile} for further information."
fi
fi

if [ -n "${MAILX_ARGS}" ]; then
sh -c "mailx -v -S sendwait ${MAILX_ARGS} < ${lastLogfile} > ${lastMailLogfile} 2>&1"
if [ $? == 0 ]; then
echo "Mail notification successfully sent."
else
echo "Sending mail notification FAILED. Check ${lastMailLogfile} for further information."
fi
fi

if [ -f "/hooks/post-backup.sh" ]; then
echo "Starting post-backup script ..."
/hooks/post-backup.sh $backupRC
Expand Down
2 changes: 1 addition & 1 deletion entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ status=$?
echo "Check Repo status $status"

if [ $status != 0 ]; then
echo "Restic repository '${RESTIC_REPOSITORY}' does not exists. Running restic init."
echo "Restic repository '${RESTIC_REPOSITORY}' does not exist. Running restic init."
restic init

init_status=$?
Expand Down

0 comments on commit 01e8734

Please sign in to comment.