Comment 3 for bug 364481

Revision history for this message
Amit Kucheria (amitk) wrote : Re: [Bug 364481] Re: offlineimap constantly goes for a spin consuming 100% cpu

> Do you run offlineimap with any kind of front-end; or does do you have
> it running as a daemon?

Through cron. My crontab entry is:

# fetch email every 10mins - less causes gmail problems
*/10 * * * * $HOME/bin/cron-run-offlineimap.sh

And cron-run-offlineimap.sh is:

#!/bin/sh

# Run offlineimap through cron to fetch email periodically

ps aux | grep "\/usr\/bin\/offlineimap"

if [ $? -eq "0" ]; then
 logger -i -t offlineimap "Another instance of offlineimap running. Exiting."
 exit 0;
else
 logger -i -t offlineimap "Starting offlineimap..."
 offlineimap -u Noninteractive.Basic
 logger -i -t offlineimap "Done offlineimap..."
fi