HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cron jobs in unix
Operating System - HP-UX
1829116
Members
2294
Online
109986
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2004 05:24 PM
01-19-2004 05:24 PM
cron jobs in unix
how to i set a cron job in hp unix server to execute a script.
THANKS FOR ALL THE REPLIES
Regds,
HARI KRISHNA
THANKS FOR ALL THE REPLIES
Regds,
HARI KRISHNA
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2004 05:39 PM
01-19-2004 05:39 PM
Re: cron jobs in unix
Hi,
You will need to make sure your login is added to /var/adm/cron/cron.allow (link from /usr/lib/cron/cron.allow) file.
Once it is there then you can use the command
'crontab -e' to invoke editor. Look at 'crontab' man page for more details on formats. The syntax is basically the following
minute hour monthday month weekday command
to run a script called /home/sridhar/mycron.sh every 15 mins, i would add the entry as
0,15,30,45 * * * * /home/sridhar/mycron.sh > /dev/null 2>&1
Once an entry is added, save the file and it should add it to cronjobs. Subsequent entries can be placed using the same command 'crontab -e'.
Alternatively, you can create a file with crontab syntax and run the command 'crontab filename' to add the entries in that file to cron.
-Sri
You will need to make sure your login is added to /var/adm/cron/cron.allow (link from /usr/lib/cron/cron.allow) file.
Once it is there then you can use the command
'crontab -e' to invoke editor. Look at 'crontab' man page for more details on formats. The syntax is basically the following
minute hour monthday month weekday command
to run a script called /home/sridhar/mycron.sh every 15 mins, i would add the entry as
0,15,30,45 * * * * /home/sridhar/mycron.sh > /dev/null 2>&1
Once an entry is added, save the file and it should add it to cronjobs. Subsequent entries can be placed using the same command 'crontab -e'.
Alternatively, you can create a file with crontab syntax and run the command 'crontab filename' to add the entries in that file to cron.
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2004 05:42 PM
01-19-2004 05:42 PM
Re: cron jobs in unix
To be allowed to schedule a cronjob as a user you have to edit the file:
/var/adm/cron/cron.allow
This file contains a list of usernames that may schedule jobs
Then became the user that wants to schedule someting and do:
crontab -e
You come in a vi session of the schedule of the current user:
Format of the file:
# Minute Hour Month Day Month Command to run
# ----------------------------------------------------------
0 01 * * * Job_1
0 02 * * * Job_2
0 03 * * * Job_3
0 04 * * * Job_4
0 * * * * Job_hourly
0 2,3,4 * * * Multiple_1
0 2,4 * * * Multiple_2
Save the file with :x
check your schedule with the command "crontab -l"
Regards,
Peter
/var/adm/cron/cron.allow
This file contains a list of usernames that may schedule jobs
Then became the user that wants to schedule someting and do:
crontab -e
You come in a vi session of the schedule of the current user:
Format of the file:
# Minute Hour Month Day Month Command to run
# ----------------------------------------------------------
0 01 * * * Job_1
0 02 * * * Job_2
0 03 * * * Job_3
0 04 * * * Job_4
0 * * * * Job_hourly
0 2,3,4 * * * Multiple_1
0 2,4 * * * Multiple_2
Save the file with :x
check your schedule with the command "crontab -l"
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2004 05:54 PM
01-19-2004 05:54 PM
Re: cron jobs in unix
Some things to bear in mind:
1) output from cronscripts is mailed to the owner of the crontab
2) your PATH settings are minimal. Specify commands with absolute pathnames or set your PATH environment variable in the scripts (I would do the latter. Makes testing more fool-proof. In vi you can do:
!!set|grep '^PATH='
to replace the current line with your current PATH environment variable.)
1) output from cronscripts is mailed to the owner of the crontab
2) your PATH settings are minimal. Specify commands with absolute pathnames or set your PATH environment variable in the scripts (I would do the latter. Makes testing more fool-proof. In vi you can do:
!!set|grep '^PATH='
to replace the current line with your current PATH environment variable.)
Every problem has at least one solution. Only some solutions are harder to find.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP