From: root Date: Fri, 3 Jul 2015 10:23:17 +0000 (+0200) Subject: MO-P: mo-backup rewritten to use rsync X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ed3ad73483b319e85322b028ea09541d2b7fef6c;p=moe.git MO-P: mo-backup rewritten to use rsync Also, it now avoids files larger than 64MB. --- diff --git a/mop/admin/mo-backup.sh b/mop/admin/mo-backup.sh index 94bb2e9..5772bc1 100644 --- a/mop/admin/mo-backup.sh +++ b/mop/admin/mo-backup.sh @@ -6,18 +6,13 @@ if [ -z "$1" ] ; then else D=$1 fi +echo "Backing up to $D" mkdir -p $D -for m in {1,2,3,4,5,6}{1,2,3,4,5,6,7,8}; do +for m in 1{1,2,3,4} {2,3,4,5,6}{1,2,3,4,5,6,7,8}; do m="ceoi$m" echo -n "$m: " mkdir -p $D/$m - pushd $D/$m >/dev/null - ssh root@$m 'cd /mo/users ; tar czf - . --exclude=.kde --exclude=.mozilla --exclude=.cache' | tar xzf - - popd >/dev/null + rsync -a --max-size=64M root@$m:/mo/users/ $D/$m/ --exclude .kde --exclude .mozilla du -s $D/$m | cut -f 1 done - -#echo -n "submit: " -#rsync -a mo-submit@mo21: $D/submit/ -#du -s $D/submit | cut -f 1