Compare commits

..

3 commits

Author SHA1 Message Date
f
3163150be5
feat: send log to zulip
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-09-28 10:22:09 -03:00
f
91bf0bbe06
Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista 2023-09-28 10:18:20 -03:00
f
1233c89aff fix: use proper namespaces 2023-08-24 11:50:53 -03:00
2 changed files with 11 additions and 7 deletions

View file

@ -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

View file

@ -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 $?