From: micah Date: Wed, 13 Feb 2008 16:57:54 +0000 (+0000) Subject: move -maxdepth 1 option before -type d due to find giving this warning when it is... X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d1f8d4e7c31d26e3c6c5853d4c368669f1168422;p=matthijs%2Fupstream%2Fbackupninja.git move -maxdepth 1 option before -type d due to find giving this warning when it is after: find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments. git-svn-id: http://code.autistici.org/svn/backupninja/trunk@555 758a04ac-41e6-0310-8a23-8373a73cc35d --- diff --git a/handlers/maildir.in b/handlers/maildir.in index 7a68e85..34668fb 100644 --- a/handlers/maildir.in +++ b/handlers/maildir.in @@ -157,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 @@ -201,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