Cron
“cron is a time-based job scheduler in Unix-like” wikipedia
*/5 * * * * ~/app/alarms.py >> ~/app/log/alarm_error.log 2>&1
List of current cron jobs
crontab -l
Edit cron jobs
crontab -e
Example of cron job
*/5 * * * * ~/app/alarms.py >> ~/app/log/alarm_error.log 2>&1
* * * * * /usr/bin/rsync -azv ~/python/cli name@server:<folder> > /dev/null
* * * * * apache cd /var/www/project; /usr/bin/php index.php cli index 2>&1 > /tmp/project.log
Good resources:
- Prevent cronjobs from overlapping in Linux, useage of Flock
- Using systemd as a better cron
Ref: Cron_job