add systembackup to stretch setup
This commit is contained in:
parent
dc90149ecc
commit
623fc9d8f9
@ -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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user