add systembackup to stretch setup

This commit is contained in:
Gero Müller 2017-06-12 11:07:00 +10:00
parent dc90149ecc
commit 623fc9d8f9

View File

@ -54,7 +54,13 @@ for i in {4..6}; do
done done
echo "setup systembackup" echo "setup systembackup"
if [ ! -f /root/.ssh/id_rsa ]; then
ssh-keygen
fi
cat /root/.ssh/id_rsa.pub
wget -q -O /usr/local/sbin/systembackup https://code.camijo.de/gmueller/server-scripts/raw/master/systembackup wget -q -O /usr/local/sbin/systembackup https://code.camijo.de/gmueller/server-scripts/raw/master/systembackup
chmod +x /usr/local/sbin/systembackup
if [ ! -f /etc/systembackup.conf ]; then if [ ! -f /etc/systembackup.conf ]; then
cat >>/etc/systembackup.conf <<EOF cat >>/etc/systembackup.conf <<EOF
REPOSITORY= REPOSITORY=
@ -64,5 +70,15 @@ EOF
fi fi
( exec ne /etc/systembackup.conf ) ( exec ne /etc/systembackup.conf )
if [ ! -f /etc/cron.d/systembackup ]; then
cat >>/etc/cron.d/systembackup <<EOF
18 */4 * * * root /usr/local/sbin/systembackup
EOF
fi
( exec ne /etc/cron.d/systembackup )
source /etc/systembackup.conf
BORG_PASSPHRASE=$PASSPHRASE borg init $REPOSITORY
} }