neb/tools/server-setup.d/50-backup-setup.sh

15 lines
373 B
Bash
Raw Permalink Normal View History

2023-10-26 14:30:45 +02:00
#!/bin/sh
HOSTNAME=${HOSTNAME:-$(hostname)}
if ! [ -d /mnt/backups/restic/$HOSTNAME ]; then
echo "creating restic repo for $HOSTNAME..."
if ! [ -f /etc/ixvd/secrets/restic/$HOSTNAME.secret ]; then
echo "no secret for $HOSTNAME found."
exit 1
fi
restic \
-r /mnt/backups/restic/$HOSTNAME \
-p /etc/ixvd/secrets/restic/$HOSTNAME.secret \
init
fi