X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=blobdiff_plain;f=handlers%2Fmaildir.in;h=34668fb66e7e214c3c57fc0c2bb09c856bf9d673;hp=0d88e9271ef016702574c1295bd4005a9cf22069;hb=3d1389c7fe72aaf27bb6bd2f9c759954a853f754;hpb=f11befa73ab463cf0994d173438d65c5ab320545 diff --git a/handlers/maildir.in b/handlers/maildir.in index 0d88e92..34668fb 100644 --- a/handlers/maildir.in +++ b/handlers/maildir.in @@ -62,7 +62,10 @@ srcdir=${srcdir%/} [ "$multiconnection" == "notset" ] && fatal "The maildir handler uses a very different destination format. See the example .maildir for more information" -[ ! $test ] || testflags="--dry-run -v" +if [ $test ]; then + testflags="--dry-run -v" +fi + rsyncflags="$testflags -e 'ssh -p $destport' -r -v --ignore-existing --delete --size-only --bwlimit=$speedlimit" excludes="--exclude '.Trash/\*' --exclude '.Mistakes/\*' --exclude '.Spam/\*'" @@ -154,7 +157,7 @@ function do_rotate() { fi # Rotate the current list of backups, if we can. - oldest=\`find $backuproot -type d -maxdepth 1 -name \$rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1\` + oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1\` #echo "Debug: oldest \$oldest" [ "\$oldest" == "" ] && oldest=0 for (( i=\$oldest; i > 0; i-- )); do @@ -198,7 +201,7 @@ function do_rotate() { for rottype in daily weekly monthly; do max=\$((keep\${rottype}+1)) dir="$backuproot/\$rottype" - oldest=\`find $backuproot -type d -maxdepth 1 -name \$rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1\` + oldest=\`find $backuproot -maxdepth 1 -type d -name \$rottype'.*' | @SED@ 's/^.*\.//' | sort -n | tail -1\` [ "\$oldest" == "" ] && oldest=0 # if we've rotated the last backup off the stack, remove it. for (( i=\$oldest; i >= \$max; i-- )); do