[H-GEN] chestnut
Russell Stuart
russell at stuart.wattle.id.au
Thu Mar 27 00:36:11 EST 2003
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
> You could always use rsync, it's neat for this type of operation
> (especially locally).
>
> mkdir /var/backups/disk2/current
> mkdir -p /var/backups/disk2/old/$(date +%d-%m-%Y)
>
> cd /var/backups/disk2/current
> rsync -av --delete -b \
> --backup-dir /var/backups/disk2/old/$(date +%d-%m-%Y) \
> /home/imap /var/backups/disk2/current/
Impressive. I obviously have never paid enough attention to the rsync
man page. This would work well if the mail boxes are stored in maildir
format, but not if mbox is used. Since we are now thinking laterally,
this would cover both cases:
[ -d /home/var/backups/disk2/current ] && (
cd /var/backups
diff -Nur /home/imap disk2/current |
bzip2 -9 >/var/backups/disk2/$(date +%d-%m-%Y)
)
rm -r /var/backups/disk2/current
cp -Rp /home/imap /var/backups/disk2/current
Getting a file back would require you to run patch for each day you
wanted to go back:
cp -Rp /var/backups/disk2/change oldmail
bunzip2 < /var/backups/disk2/ddmmyy | patch -D oldmail -p 2
bunzip2 < /var/backups/disk2/ddmmyy | patch -D oldmail -p 2
:
:
On second thoughts, its very complex, isn't it? You would want
to be desperate for disk space. It lacks the one major feature
of Sandra's solution - KISS. In this case I think KISS may win,
for me anyway.
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'. See http://www.humbug.org.au/
More information about the General
mailing list