Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie crontab question

Status
Not open for further replies.

danatural

MIS
Jan 6, 2003
9
US
Hello all,

can anyone tell me how to edit a crontab? I know the edit command is crontab -e... but once I'm in where do I go from there?

Thanks in advance.

 
Once you've typed crontab -e you will need to edit with 'vi' commands, so you might want to do a google search for "vi quick reference". An infinite number of monkey typing at an infinite number of keyboards will eventually populate the internet.
 
danatural,

Here is something I have found handy when adding something to cron -- a "cheat sheet" on which field is for which time unit. I've actually added the first 6 lines below to the top of my crontab and I show a sample command.

# minute (0-59)
# | hour (0-23)
# | | day of the month (1-31)
# | | | month of the year (1-12)
# | | | | day of the week (0-6 with 0=Sunday)
# / / / / / commands
0 3 * * * /usr/sbin/skulker

Also, if you don't want to get an email everytime the command is run from cron, add this after the command:

>> /dev/null 2>&1
 
Hi
Thanks so much. I'm learning more and more everyday I read and get advise from all of you.

Take it easy.
 
don't forget to specify the complete path off the command
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top