Reliability and shutdown

Tim Gray lists+offimap at protozoic.com
Mon May 14 18:36:27 BST 2012


On May 14, 2012 at 10:36 PM +0530, Sriram ET. wrote:
>Can you share you wrapper scripts? Others have similar issues could give it
>a try, and we could possibly include it in the main distribution?

Actually, it seems I mispoke.  I *used* to use some script like that for 
several years, up until alst fall.  I still have that script but I can't 
vouch that it works anymore.  I was forced to stop using it because an 
upgrade to OS X made a change which impacted how offlineimap got the 
account passwords.  So I moved to running it in single mode.

It still does hang periodically for unknown reasons (once every 2-3 
weeks), but I've not yet automated restarting it.  If I notice my mail 
not coming in, I kill it and remove the lock file.  I could repurpose 
the original script, but haven't gotten around to it.

All the script really did was to write a simple file with the time of 
last sync, PID of offlineimap, and my IP address.  offlineimap was then 
started.  Upon the next run, if the information existed but hadn't 
changed and the timeout hadn't elapsed (either because it was too recent 
or because offlineimap was syncing properly) then the script exited and 
let the current offlineimap process live.  If the time of last sync was 
greater than some timeout limit, or my IP address was changed, the 
process was killed and restarted.  Since offlineimap doesn't write your 
IP address to a file, nor the time of last syncing, I had called it from 
the same script, and recorded that information if it didn't exist.  I 
also had a line calling nmap to query if I had a connection to my mail 
server.  If not, offlineimap (and getmail) weren't run at all.

I've attached the script anyway.  It's no work of art, but it more or 
less worked until OS X 10.7.  And would have continued to work had I 
left my IMAP passwd in the offlineimap rc file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: offlineimap-loop.sh
Type: application/x-sh
Size: 2688 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20120514/e7334389/attachment-0003.sh>


More information about the OfflineIMAP-project mailing list