Complete.Org: Mailing Lists: Archives: offlineimap: November 2007:
Re: OfflineIMAP for backups
Home

Re: OfflineIMAP for backups

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: Re: OfflineIMAP for backups
From: "David L. Emerson" <demerson3x@xxxxxxxxxxxxx>
Date: Fri, 30 Nov 2007 10:46:31 -0800

> ... I believe that the worry is that a filesystem error on the
> backup _could_ lead to the loss of a file (a message) on the
> backup, and then OfflineIMAP would sync this disappearance back to the
> live mailbox. There is indeed a problem then ... It would be desirable
> that _no_ possible chain of events in the backup system could possibly
> affect the backed-up (?) system in the first place - the only way to
> ensure that is to make the backup process purely one-way, which
> OfflineIMAP isn't. 

You could wrap offlineimap in a little script that does the following:
- After running offlineimap, do a simple 'find' on the Maildir, output 
it to a file
- Before running offlineimap, do the same, and compare the results -- 
then you'll know if any changes have occurred between runs of 
offlineimap. If changes occurred, don't run offlineimap.
- If your backup system deletes files while offlineimap is running, 
you're screwed :)


#!/bin/sh
# I'm not such a portability expert as to know with absolute
# certainty that this is 'sh' compatible, but I *think* it is.

before_file=/some/path/maildir-before
after_file=/some/path/maildir-after

if ! find /path/to/my/maildir >$before_file; then
    echo "find failed, before running offlineimap. exiting..."
    exit 1
fi

if diff $before_file $after_file; then
    offlineimap
    if ! find /path/to/my/maildir >$after_file; then
        echo "find failed, AFTER running offlineimap."
        exit 2
    fi
else
    echo "differences were found between $before_file and $after_file."
    echo "not running offlineimap"
    exit 3
fi

Enjoy!
~David.




[Prev in Thread] Current Thread [Next in Thread]