3

I have offlineimap running on a cron job with */10 * * * * offlineimap -q -u quiet. Every once in a while it seems to get interrupted, and when that happens I can't restart it. If I try to run it from the terminal I get an error indicating that it is locked:

OfflineIMAP 6.5.5
  Licensed under the GNU GPL v2+ (v2 or any later version)
Account sync Example:
 *** Processing account Example
 ERROR: Could not lock account Example. Is another instance using this account?
 *** Finished account 'Example' in 0:00
ERROR: Exceptions occurred during the run!
ERROR: Could not lock account Example. Is another instance using this account?

Traceback:
  File "/usr/lib/python2.7/dist-packages/offlineimap/accounts.py", line 240, in syncrunner
    self.lock()
  File "/usr/lib/python2.7/dist-packages/offlineimap/accounts.py", line 207, in lock
    OfflineImapError.ERROR.REPO)

Is there any way to break the lock or force offlineimap to quit all the way?

Amanda
  • 1,709
  • 2
  • 13
  • 26
  • You could run a postsync hook to clean up any lock files... But you are probably better off fixing the interrupts and addressing the cause, not the symptom. – jasonwryan Apr 19 '16 at 06:13
  • The cause varies. Usually it is something like closing my laptop in the middle of a sync. It would be nice if there was a way to recover. – Amanda Apr 19 '16 at 20:07
  • Can you edit your crontab line in to the question? I have no such issues... – jasonwryan Apr 19 '16 at 20:43
  • `*/10 * * * * offlineimap -q -u quiet` – Amanda Apr 19 '16 at 21:01
  • You definitely want something more robust than that. See the [Arch Wiki](https://wiki.archlinux.org/index.php/OfflineIMAP#Running_offlineimap_in_the_background) if you use systemd, if not, you can use a script to properly daemonize it. – jasonwryan Apr 19 '16 at 21:20

1 Answers1

0

This seems to be resolved in OfflineIMAP 6.6.1.

Amanda
  • 1,709
  • 2
  • 13
  • 26