X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fmaildir;h=1bca84eeb14b72da0c3153632623ae7a5985ed64;hb=c8efb40b7febbdd2aee03996938e6d8c63c06377;hp=0af8ff7c7d66e320cc6c5f5c84c80ea6c66c2a4a;hpb=ceb80d70b187964af9c9ad914fbd56a175424a62;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/maildir b/handlers/maildir index 0af8ff7..1bca84e 100644 --- a/handlers/maildir +++ b/handlers/maildir @@ -1,3 +1,5 @@ +# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- + ############################################################### # # This handler slowly creates a backup of each user's maildir @@ -12,7 +14,17 @@ # weekly.2 # monthly.1 # if keepdaily is 3, keepweekly is 2, and keepmonthly is 1. -# +# +# The basic algorithm is to rsync each maildir individually, +# and to use hard links for retaining historical data. +# +# We rsync each maildir individually because it becomes very +# unweldy to start a single rsync of many hundreds of thousands +# of files. +# +# For the backup rotation to work, destuser must be able to run +# arbitrary bash commands on the desthost. +# ############################################################## getconf rotate yes @@ -101,8 +113,8 @@ $dir $destuser@$desthost:$destdir/$letter \ # and add new ones which have just been created. function do_remove() { - local tmp1=/tmp/maildirtmpfile$$ - local tmp2=/tmp/maildirtmpfile$$ + local tmp1=`maketemp maildir-tmp-file` + local tmp2=`maketemp maildir-tmp-file` 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 ls -1 "$srcdir/$i" | sort > $tmp1