Compare commits
3 commits
5e098f58e9
...
3163150be5
Author | SHA1 | Date | |
---|---|---|---|
|
3163150be5 | ||
|
91bf0bbe06 | ||
|
1233c89aff |
2 changed files with 11 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
ARG ALPINE_VERSION=3.13.6
|
ARG ALPINE_VERSION=3.18.3
|
||||||
ARG BASE_IMAGE=sutty/monit
|
ARG BASE_IMAGE=gitea.nulo.in/sutty/monit
|
||||||
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
||||||
MAINTAINER "f <f@sutty.nl>"
|
MAINTAINER "f <f@sutty.nl>"
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ ENV SSH_SERVER ""
|
||||||
ENV SSH_USER root
|
ENV SSH_USER root
|
||||||
ENV SSH_PORT 22
|
ENV SSH_PORT 22
|
||||||
|
|
||||||
RUN apk add --no-cache borgbackup openssh-client
|
RUN apk add --no-cache borgbackup openssh-client zulip-client
|
||||||
|
|
||||||
COPY ./monit.conf /etc/monit.d/borg.conf
|
COPY ./monit.conf /etc/monit.d/borg.conf
|
||||||
COPY ./backup.sh /usr/local/bin/backup
|
COPY ./backup.sh /usr/local/bin/backup
|
||||||
|
|
12
backup.sh
12
backup.sh
|
@ -35,9 +35,13 @@ for signal in TERM QUIT HUP EXIT INT KILL; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# It'll fail the second time
|
# It'll fail the second time
|
||||||
borg init --encryption=repokey "${SSH_ALIAS}:${DEST}"
|
borg init --encryption=repokey "${SSH_ALIAS}:${DEST}" 2>&1 | tee /tmp/backup.log
|
||||||
borg create -v --stats "${SSH_ALIAS}:${DEST}::${DATE}" "${ORIG}"
|
borg create -v --stats "${SSH_ALIAS}:${DEST}::${DATE}" "${ORIG}" 2>&1 | tee -a /tmp/backup.log
|
||||||
borg prune -v --stats --keep-daily ${KEEP} "${SSH_ALIAS}:${DEST}"
|
borg prune -v --stats --keep-daily ${KEEP} "${SSH_ALIAS}:${DEST}" 2>&1 | tee -a /tmp/backup.log
|
||||||
borg list "${SSH_ALIAS}:${DEST}"
|
borg list "${SSH_ALIAS}:${DEST}" 2>&1 | tee -a /tmp/backup.log
|
||||||
|
|
||||||
|
if test -n "${ZULIP_KEY}"; then
|
||||||
|
cat /tmp/backup.log | zulip-client -u "${ZULIP_URL}" -b "${ZULIP_BOT}" -s "${ZULIP_STREAM}" -t "${ZULIP_TOPIC}"
|
||||||
|
fi
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|
Loading…
Reference in a new issue