Here is a quick howto on crontab, crontab is a text file that has a list of commands that are to be run at specified times, the command and their run times, are controlled by the cron daemon and are executed in the system's background, the system maintains a crontab for each user, you will be able to edit the crontab file by using the -e switch when using the crontab command like so:
$ crontab -e
If this is the first time you have used crontab the list may be blank.
All you need to now to use crontab and schedule a command is when you will run it and when you will want it to run
minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command
An example entry would be
* 10 * * 1,3,5 /usr/bin/updatedb
The entry above will execute updatedb on 10am every monday, tuesday, friday, after saving the file you can view the crontab entry by using the -l option
$ crontab -l
$ crontab -e
If this is the first time you have used crontab the list may be blank.
All you need to now to use crontab and schedule a command is when you will run it and when you will want it to run
minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command
An example entry would be
* 10 * * 1,3,5 /usr/bin/updatedb
The entry above will execute updatedb on 10am every monday, tuesday, friday, after saving the file you can view the crontab entry by using the -l option
$ crontab -l
Thats it.
Tech Blog Quick List of howto's:
- Tech Blog easy 10 Steps | Remove Virus | Spyware Scanner Download | Free Software
- Tech Blog easy Network troubleshooting | DNS Problem Guide
- Howto change DNS Server IP to OpenDNS
- Tech Blog Howto Fix | COM Surrogate Error | Windows Vista
- 9 Easy Steps | Setting up a secured home wireless network
- Tech Blog Howto Permanently deleting files | data on your hard disk
- Tech Blog Howto Do Full filesystem backup | ufsdump - For *nix
- Tech Blog Fix Slow HD | 1080p Playback | troubleshooting | Fix
- Sendmail | Banner change | Disabling VRFY | EXPN
- iPod charging on DVD player w/o dock
- Apple Ipod Jailbreak - 1.1.4 firmware guide and Quickpwn
- Optimize Windows XP | VIsta
- Tech Blog Howto Hard Disk Recovery | Data Recovery | Test Disk
- Import Outlook PST to Gmail Howto
- Tech Blog Howto Bypass Firewall | Proxy with SSH | Hamachi
- Permanently deleting files | data on your hard disk
- Tech Blog Tutorial Hamachi VPN a quick guide
- Tech Blog Special Build your own IDS or IPS
- Download Video from YouTube to your computer
- Tech Blog Howto Do Bandwidth Monitoring | Free software
- Ubuntu Linux | Multiple IP | IP Aliasing | Howto
- Tech Blog Howto jailbreak iPhone and Ipod touch 2.2 Firmware
- Nokia N96 GPS and Google Earth on your PC
- Sharing folder with Windows on Ubuntu using Samba
- Tech Blog Fix for EMC PowerPath - Removal Error
2 comments:
You may want to check the syntax on your example. If I'm not mistaken, your entry actually says to execute updatedb every minute from 10:00am to 10:59am, not just 10:00am. I believe the first entry should be 0 instead of *.
Also, it will execute updatedb on mondays, wednesdays and fridays. (Not on tuesday :))
Post a Comment