Skip to main content

rdiff-backup

#!/bin/bash

SERVEURS="HOSTNAME.SEVER.COM 127.0.0.1"
RDIFFEXCLUSIONS="--exclude /mnt --exclude /media --exclude /proc --exclude /dev --exclude /sys --exclude /var/lib/lxcfs --exclude-sockets"
RDIFFOPTS="--print-statistics"

DATE=`date +%Y-%m-%d`

echo "------------------------------------"
echo "---- Starting Backup `date` ----"

for SERVER in $SERVERS
do
 echo "---- Backup for $SERVER ----"
 echo "---- Start: `date` ----"
 time rdiff-backup --remote-schema 'ssh -C %s rdiff-backup --server' $RDIFFEXCLUSIONS $RDIFFOPTS root@$SERVER::/ /backup/$SERVER
 echo "---- End: `date` ----"
done

echo "---- End of the backup `date` ----"