aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorElijah Saxon <elijah@riseup.net>2008-02-19 20:31:52 +0000
committerElijah Saxon <elijah@riseup.net>2008-02-19 20:31:52 +0000
commit2a61e873bc0d68843ad30c1b89b6e14f6ca79ea8 (patch)
treed28cdac385bba1aaa91307c91a34f52454fffe63 /handlers
parent3d1389c7fe72aaf27bb6bd2f9c759954a853f754 (diff)
downloadbackupninja-2a61e873bc0d68843ad30c1b89b6e14f6ca79ea8.tar.gz
backupninja-2a61e873bc0d68843ad30c1b89b6e14f6ca79ea8.tar.bz2
fixed bug where maildirs that start with a number were skipped. make deleted maildirs record the date they were deleted
Diffstat (limited to 'handlers')
-rw-r--r--handlers/maildir.in5
1 files changed, 3 insertions, 2 deletions
diff --git a/handlers/maildir.in b/handlers/maildir.in
index 34668fb..5922d1e 100644
--- a/handlers/maildir.in
+++ b/handlers/maildir.in
@@ -52,7 +52,7 @@ getconf destuser
getconf multiconnection notset
-letters="a b c d e f g h i j k l m n o p q r s t u v w x y z"
+letters="0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z"
failedcount=0
# strip trailing /
destdir=${destdir%/}
@@ -111,13 +111,14 @@ function do_remove() {
local tmp2=`maketemp maildir-tmp-file`
ssh -p $destport $destuser@$desthost mkdir -p "$destdir/deleted"
- for i in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
+ for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z; do
ls -1 "$srcdir/$i/" | sort > $tmp1
ssh -p $destport $destuser@$desthost ls -1 "$destdir/$i/" | sort > $tmp2
for deluser in `join -v 2 $tmp1 $tmp2`; do
[ "$deluser" != "" ] || continue
info "removing $destuser@$desthost:$destdir/$i/$deluser/"
ssh -p $destport $destuser@$desthost mv "$destdir/$i/$deluser/" "$destdir/deleted"
+ ssh -p $destport $destuser@$desthost "date > '$destdir/$i/$deluser/deleted_on'"
done
done
rm $tmp1