Improved Plan B scripts.
This commit is contained in:
parent
d905389517
commit
6ebe7b8831
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/bash -x
|
||||
|
||||
help()
|
||||
{
|
||||
|
@ -17,14 +17,10 @@ fi
|
|||
if (( $help )); then
|
||||
help
|
||||
else
|
||||
MACHINE="$1"
|
||||
COMPUTER="$1"
|
||||
REMOTE_USER=admin666
|
||||
echo "===== $COMPUTER ====="
|
||||
# rsync
|
||||
rsync root@${COMPUTER} /var/backups/borg/mirrors/$COMPUTER --exclude
|
||||
|
||||
# Backup the rsync directory.
|
||||
CONFIG="/etc/borgmatic.d/$COMPUTER.conf"
|
||||
CONFIG="/etc/borgmatic.d/$COMPUTER.yaml"
|
||||
if [ -f "$CONFIG" ]; then
|
||||
borgmatic -c $CONFIG create $OPTIONS --stats --verbosity 1 --syslog-verbosity 1
|
||||
fi
|
||||
|
|
|
@ -23,9 +23,14 @@ if (( $help )); then
|
|||
else
|
||||
COMPUTER="$1"
|
||||
|
||||
# TODOOOOOOOOOOOOOOOOOOOOOOOOOO
|
||||
echo "== Create the mirroring directory."
|
||||
mkdir /var/backups/borg/mirrors/${COMPUTER}
|
||||
|
||||
echo "== Create dedicated cache."
|
||||
mkdir /var/backups/borg/mirrors/${COMPUTER}.cache
|
||||
|
||||
echo "== Create the borgmatic configuration file."
|
||||
cp /srv/borg/models/model-conf-remote.yaml /etc/borgmatic.d/${COMPUTER}.yaml
|
||||
cp /srv/borg/models/model-conf-rsync.yaml /etc/borgmatic.d/${COMPUTER}.yaml
|
||||
|
||||
echo "== Update the repository directory in borgmatic configuration file."
|
||||
sed -i s/\<HOSTNAME\>/${COMPUTER}/g /etc/borgmatic.d/${COMPUTER}.yaml
|
||||
|
|
Loading…
Reference in New Issue