diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-09-18 19:43:27 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-09-18 19:43:27 -0300 |
commit | 5c9b124f84016d285a49936157882aa81f15a772 (patch) | |
tree | b2fa432bbea4c82a0dff482310a54996eee8b638 /files | |
parent | a392b0c9fb7279b6c232cdba84df4d3c76792f17 (diff) | |
download | puppet-backup-5c9b124f84016d285a49936157882aa81f15a772.tar.gz puppet-backup-5c9b124f84016d285a49936157882aa81f15a772.tar.bz2 |
Adding script sync-backups
Diffstat (limited to 'files')
-rw-r--r-- | files/sync-backups | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/files/sync-backups b/files/sync-backups new file mode 100644 index 0000000..b75fe90 --- /dev/null +++ b/files/sync-backups @@ -0,0 +1,21 @@ +#!/bin/bash +# +# sync a removable volume with system backups. +# + +NODE="$1" +MEDIA="/media/usb" +BWLIMIT="5000" +RSYNC="nice -n 19 rsync -av --delete --bwlimit=$BWLIMIT" + +if [ ! -z "$NODE" ]; then + for node in `ls /var/vservers/$NODE/var/backups/remote/`; do + $RSYNC /var/vservers/$NODE/var/backups/remote/$node/ /$MEDIA/$node/ + done +else + $RSYNC /var/backups/duplicity/ /$MEDIA/$HOSTNAME/ + + for node in `ls /var/backups/remote/`; do + $RSYNC /var/backups/remote/$node/ /$MEDIA/$node/ + done +fi |