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

Need to use CRON on HP Unix to run a script every night

Status
Not open for further replies.

Persistent

Programmer
Jul 17, 2001
3
US
We want to run a Unix script my buddy gave me that brings up the PeopleSoft app server every night. Problem is; we dont have autosys or maestro or anything but cron. Never used it but I hear you schedule jobs/scripts with it. Need to run every night and make sure it completes - any ideas ??
 
You can easily schedule any script to run through cron. If the script has error checking, that would take care of making sure the script is run.

If a user other than root needs to run the script, you have to add that user (and root) to the cron.allow file. To add the script to the user's crontab, su to the user and type crontab -e.

Do a man on crontab to see how to use the crontab command to schedule something in cron. The man page includes the format for how the time is expressed in a crontab entry.
 
1. First copy your crontab file into a temporary file
----------------------------------------------------------
crontab -l > tempfile

2. Edit the temp file
----------------------------------------------------------
vi tempfile

3. Enter the following into the file.
----------------------------------------------------------
00 23 * * 0-6 [script location and name]

This will run the script everynight at 11pm.

4. Exit and save the file. Press Esc key and type:
----------------------------------------------------------

:wq!

5. Make the tempfile your new cron file
----------------------------------------------------------
crontab tempfile

Hope this helps.

Nez.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top