We’ve been showing people how to automate various tasks in Linux for quite a while now. Today, we would like to briefly show people how to automate tasks in Linux using Cron jobs.
You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use crontab if your name does not appear in the file /usr/lib/cron/cron.deny. If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab. The allow/deny files consist of one user name per line.
Crontab is pretty straight forward… Minute, Hour, Day of the Week, Day of the Month, Month are all options that you can set…
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
0 3 * * * /usr/local/sbin/dumpdatabases
This is my scheduled database backup. This task is scheduled to run every day at 3AM. After the jump is a breakdown of everything.
|
Minute |
Hour |
DOM |
Month |
DOW |
Full File Location |
|
0 |
3 |
* |
* |
* |
/usr/local/sbin/dumpdatabases |
Minute: 0-59 are valid
Hour: 24 hour clock (army time)
Day Of Month: 1-31 are valid
Month: 1-12 are valid (1 is January, 2 is February)
Day Of Week: 0-6 are valid (0 is Sunday, 1 is Monday)
Full File Location: Make sure you put the FULL path to the script you’re automating.
What is the * for? This means to run it on every option for that field. In this example it is run every day of every week of every month at 3:00AM.
To collect the cron execution execution log in a file:
30 18 * * * rm /home/joe/tmp/* > /home/joe/cronlogs/clean_tmp_dir.log
Related Posts: On this day...
- "How I got a blank book to the top of the Amazon charts" - 2011
- Actually, know what? Insane Clown Posse "Miracles" video is pure awesome - 2010
- Learn Science with Insane Clown Posse - 2010
- Ending the Fed From the Bottom Up - 2010
- Statebook - 2009
- Bush Administration Set to Use New Spy Program in U.S. - 2008
- Senators Accuse Homeland Security Of Bullying States on National ID - 2008
- Experts hack power grid in no time - 2008
- Firefox Logo Found In Deep Space - 2008

BeautyandBoost.com
Music
















Anyone involved with cron job scheduling might find this resource useful.
Cron Sandbox at HxPI is an interactive webpage where you can play with crontab command strings.
Enter your ‘m h D M Dw’ parameters and immediately see all the times cron would run your job in the coming days/weeks.
Newcomers to cron job scheduling get a safe place to learn crontab commands and try examples from tutorials.
System Administrators get a forward schedule to help manage system loading.
http://www.hxpi.com/cron_sandbox.php
Great dude!!!!!! thanks for sharing!!!!!
Woah guys the expendables will be awesome
I agree jordon’s social game was great she not only convinced people to side with her and rachel but she made then go out of their way not to nominate her all season. She did it a subtle way she was probably the most liked and the most under estimated person in the house as for her win you are assuming that brendon and jeff would have won that hoh. By the time jeff and brendon played jordon had already knock everyone out of the game but who is to say they would have won what matters is she did win