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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRON TO RUN EVERY MONDAY MORNING AT 7.00AM

Status
Not open for further replies.

muralisai25

IS-IT--Management
Jul 20, 2002
51
0
0
US
Hi HOw can i schedule a cron job to run a script every MONDAY at 7.00AM in the morning.

Thanks
 
Hi,

If you want to run the job as root, then become root and then edit your current cron jobs using:

#crontab -e


Add the line:


0 7 * * 1 path_to_script


where path_to_script means the absolute path to your script.

Save changes.

That's it.

bbandolero
 
I would also add at the end of the line of the cron job:
>/dev/console 2>&1
 
And don't forget to make sure that whatever environment variables ($PATH etc) the job needs are set explicitly as cron doesn't have it's own. Do a search in this forum for examples, as this is one of the commonest problems people tend to get with cron (an example solution is at Thread80-139586). HTH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top