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

how do you cron a script 2

Status
Not open for further replies.

gman10

Technical User
Joined
Jul 20, 2001
Messages
451
Location
US
Hi all-

Extremely new to HP -UX, just curious on how you generally assign a script to a CRON.. this seems easy but am not quite getting it..

thx for any help at all

gt
 
As in other flavors of Unix, login as the user who you want to run the script, type crontab -e and set up the script to run.

This assumes that the user is not on the cron.deny file or, if it exists, IS on the cron.allow file.

Also, try doing a man crontab for additional information.
 
bi-

thanks, good info and I appreciate it!

gt
 
Say your script is called run_time and it's location is /home/me/ you would type in:

30 20 * * 1-5 /home/me/run_time > /home/me/run_time.log

the first value(30) signifies the minutes, the next hours, days ,month, way of the week. So in the example I'm setting this to run at 9:30pm monday thru friday.

HTH,

jocasio
 
Here is something I put in my crontabs so I don't have to look up the fields in the crontab all the time:

# Crontab format:
#
# 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


The first field is minutes, second hours, etc.

Thanks for the star!
 
Thanks to bi and jocasio!! People.. this really does help, hve a great day!


GT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top