Skip to content

Commit

Permalink
Fix mailx setup for latest restic image that is based on latest alpine
Browse files Browse the repository at this point in the history
- mailx is known as mail in alpine
  • Loading branch information
niondir committed Aug 5, 2023
1 parent 1d222b9 commit a018fdc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN unzip rclone-current-linux-amd64.zip && mv rclone-*-linux-amd64/rclone /bin/

FROM restic/restic:0.16.0

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

COPY --from=rclone /bin/rclone /bin/rclone

Expand Down Expand Up @@ -54,8 +54,5 @@ COPY backup.sh /bin/backup
COPY check.sh /bin/check
COPY entry.sh /entry.sh


WORKDIR "/"

ENTRYPOINT ["/entry.sh"]
CMD ["tail","-fn0","/var/log/cron.log"]
2 changes: 1 addition & 1 deletion backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if [ -n "${TEAMS_WEBHOOK_URL}" ]; then
fi

if [ -n "${MAILX_ARGS}" ]; then
sh -c "mailx -v -S sendwait ${MAILX_ARGS} < ${lastLogfile} > ${lastMailLogfile} 2>&1"
sh -c "mail -v -S sendwait ${MAILX_ARGS} < ${lastLogfile} > ${lastMailLogfile} 2>&1"
if [ $? == 0 ]; then
echo "Mail notification successfully sent."
else
Expand Down
2 changes: 1 addition & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if [ -n "${TEAMS_WEBHOOK_URL}" ]; then
fi

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

0 comments on commit a018fdc

Please sign in to comment.