notes:avoid_duplicated_cron_jobs_with_flock
Differences
This shows you the differences between two versions of the page.
Next revision | Previous 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: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.1509795105.txt.gz · Last modified: 2017/11/04 11:31 (external edit)