cron
# List Crontabs
crontab -l
# List Crontabs for user1
crontab -u user1 -l
# Create/edit Crontabs
crontab -e
# explain:
# m h dom mon dow command
# m = minutes (0-59)
# h = hours (0-23)
# dom = day of month (1-31)
# mon = calendar month (1-12)
# dow = weekday (0-7)
# examples :
# on every reboot
@reboot /usr/bin/screen -dmS gameserver-screen /opt/mycoolgame/bin/gameserver
@reboot (. ~/.profile; /usr/bin/screen -dmS gameserver-screen /opt/mycoolgame/bin/gameserver)
# Ping once every minute
* * * * * /bin/ping -c 1 192.168.1.1
# execute shell script on saturdays
10 22 * * 6 /usr/src/dump.sh
# do a time sync every full hour
0 * * * * /usr/sbin/ntpdate time.domain.com
# run a script every 2 hours
0 */2 * * * /usr/bin/backup.sh
# run a script every 10 minutes
*/10 * * * * /usr/bin/backup.sh
# run script at 0 'clock
0 1 * * * find /share/HF_WIP/SCAN/* -mtime +5 | xargs rm
# constantly sync amazon cloud drive and log to file
0 * * * * acd_cli sync >> ~/acd_cli.log