aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-09-18 19:43:27 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-09-18 19:43:27 -0300
commit5c9b124f84016d285a49936157882aa81f15a772 (patch)
treeb2fa432bbea4c82a0dff482310a54996eee8b638 /files
parenta392b0c9fb7279b6c232cdba84df4d3c76792f17 (diff)
downloadpuppet-backup-5c9b124f84016d285a49936157882aa81f15a772.tar.gz
puppet-backup-5c9b124f84016d285a49936157882aa81f15a772.tar.bz2
Adding script sync-backups
Diffstat (limited to 'files')
-rw-r--r--files/sync-backups21
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