notes:avoid_duplicated_cron_jobs_with_flock
Differences
This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
notes:avoid_duplicated_cron_jobs_with_flock [2017/11/04 11:31] – created admin | notes:avoid_duplicated_cron_jobs_with_flock [2017/11/04 11:31] – admin | ||
---|---|---|---|
Line 7: | Line 7: | ||
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 | + | |
you can run offlineimap through flock and use / | you can run offlineimap through flock and use / | ||
- | * */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.txt · Last modified: 2017/11/04 11:35 by admin