aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-17 22:18:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-17 22:18:52 -0300
commit618f1bfb0651ae8d24228dbb5407de73aa8dc17d (patch)
tree5d0345c225b98a32fe5a529ac441fdb8f96e9044 /files
parentf425326bf10ea877623cb85747b3864c572c9cf5 (diff)
downloadpuppet-backup-618f1bfb0651ae8d24228dbb5407de73aa8dc17d.tar.gz
puppet-backup-618f1bfb0651ae8d24228dbb5407de73aa8dc17d.tar.bz2
Be ionice at sync-backups
Diffstat (limited to 'files')
-rw-r--r--files/sync-backups5
1 files changed, 3 insertions, 2 deletions
diff --git a/files/sync-backups b/files/sync-backups
index e580c30..4867701 100644
--- a/files/sync-backups
+++ b/files/sync-backups
@@ -9,7 +9,8 @@ VOLUME="$1"
MEDIA="/media/$VOLUME"
BWLIMIT="2500"
IMAGES="/var/data/crypt/"
-RSYNC="nice -n 19 rsync -avH --delete --bwlimit=$BWLIMIT"
+RSYNC="ionice -c 3 nice -n 19 rsync -avH --delete --bwlimit=$BWLIMIT"
+CP="ionice -c 3 nice -n 19"
# Sync backups for a node.
function sync_backups_node {
@@ -45,7 +46,7 @@ function sync_backups_node {
for image in `find $IMAGES -name '*.img' -type f`; do
mkdir -p /$MEDIA/$HOSTNAME/images/`dirname $image`
echo "Copying image to /$MEDIA/$HOSTNAME/images/`dirname $image`"
- cp $image /$MEDIA/$HOSTNAME/images/`dirname $image`
+ $CP $image /$MEDIA/$HOSTNAME/images/`dirname $image`
done
fi
fi