notes:avoid_duplicated_cron_jobs_with_flock
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
notes:avoid_duplicated_cron_jobs_with_flock [2017/11/04 11:31] – admin | notes:avoid_duplicated_cron_jobs_with_flock [2017/11/04 11:35] (current) – admin | ||
---|---|---|---|
Line 6: | Line 6: | ||
Let's say you want to run offlineimap every two hours. Instead of simply scheduling in crontab the program (as vmail user) with: | Let's say you want to run offlineimap every two hours. Instead of simply scheduling in crontab the program (as vmail user) with: | ||
+ | | ||
* */2 * * * vmail offlineimap | * */2 * * * vmail offlineimap | ||
you can run offlineimap through flock and use / | you can run offlineimap through flock and use / | ||
+ | | ||
* */2 * * * vmail flock -xn / | * */2 * * * vmail flock -xn / | ||
This way, every two hours cron starts offlineimap: | This way, every two hours cron starts offlineimap: |
notes/avoid_duplicated_cron_jobs_with_flock.1509795113.txt.gz · Last modified: 2017/11/04 11:31 by admin