sauvegardes/script_backups_mother.sh

23 lines
764 B
Bash

#! /bin/bash
rsync -avcHS --exclude 'var/backups' --exclude 'opt' --exclude 'sys' --exclude 'proc' --exclude 'dev' --delete / /var/backups/mother 1>> /var/log/backup.log
rsync -avcHS --exclude 'var/backups' --exclude 'opt' --exclude 'sys' --exclude 'proc' --exclude 'dev' --delete aunt.onlink:/ /var/backups/aunt 1>> /var/log/backup.log
echo "BACKUP SESSION $(date)" >> /var/log/backup.log
virt-backup backup 1>> /var/log/backup.log
virt-backup clean 1>> /var/log/backup.log
/opt/sharedfs/outils/blockcommit_all.sh
#find /var/backups -type f -exec sudo fallocate -v -d {} \;
# Wait for aunt to finish
processes=$(ssh aunt 'ps aux' | grep virt-backup)
while [ ! -z "$processes" ];
do
sleep 60
done
find /var/backups -type f -exec sudo fallocate -v -d {} \;