X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=blobdiff_plain;f=handlers%2Fmaildir;h=4b98debfbef9f26acbe82bd14ad1cd3587356b27;hp=b7c9b3e1d02b519159048c534dce4b2cc43fa991;hb=be75e4e6c536882c14db9a41c61585e7a9c045f6;hpb=e511922eaddbea461d4e82d1d3f366baecae2f86 diff --git a/handlers/maildir b/handlers/maildir index b7c9b3e..4b98deb 100644 --- a/handlers/maildir +++ b/handlers/maildir @@ -78,7 +78,10 @@ function do_user() { local letter=${user:0:1} local source="$srcdir/$letter/$user/" local target="$destdir/$letter/$user/$btype.1" - [ -d $source ] || fatal "maildir $source not found". + if [ ! -d $source ]; then + warning "maildir $source not found" + return + fi debug "syncing" ret=`$RSYNC -e "ssh -p $destport" -r \ @@ -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 -type d -maxdepth 1 -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 -type d -maxdepth 1 -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 @@ -332,7 +335,7 @@ if [ "$backup" == "yes" ]; then debug $i for user in `ls -1`; do [ "$user" != "" ] || continue - info $user + debug $user do_rotate $user setup_remote_dirs $user $btype do_user $user $btype