- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to shedule the job in crontab
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
07-12-2005 05:52 PM
07-12-2005 05:52 PM
How to shedule the job in crontab
I need to make a crontab that executes a script every night at 10 pm.
the parameter will be 00 22 * * *.
But i dont know in which file i need to pass these parameters and how to execute it.
I have made a man of crontab and cron, but it doesn't explain it.
Thanks in advance.
Regards
Musaddaq
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2005 06:00 PM
07-12-2005 06:00 PM
Re: How to shedule the job in crontab
SAM might be an easier method for you.
Be aware that if you already have cron jobs configured, you need to preserve those and include them in th efile with your new request.
This can be done by doing crontab -l > yourfile,
then edit this file adding in your job, and resubmit the whole config with crontab yourfile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2005 06:16 PM
07-12-2005 06:16 PM
Re: How to shedule the job in crontab
If there already is jobs in your ctontab, do a:
crontab -l >file
Then, edit the file (add your new job).
crontab
Check that everything is OK with:
crontab -l
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2005 06:19 PM
07-12-2005 06:19 PM
Re: How to shedule the job in crontab
you can use sam to edit this crontabfile. This gives you some help in editing also.
Alternatively you can use the crontab command. Login as the user you wish to run the command as (eg. root).
Do a crontab -l to list all current cronjobs for that user. Than use crontab -e to edit the crontabfile. You don't have to know the location of the crontab file. Edit the corntabfile to your needs and save and exit the file.
The crontab command will take care of the rest.
Hope this helps
Regards Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2005 06:24 PM
07-12-2005 06:24 PM
Re: How to shedule the job in crontab
I have solved the problem.
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2005 06:33 PM
07-12-2005 06:33 PM
Re: How to shedule the job in crontab
to create a cron you just create a file (any file) and put the entries
(min)(hr) (day of the month) (month of the year) (week day) (command)
#vi try
put the entries
then you can do
#crontab try (try is you file name)
thats it
then there will be a file in /var/spool/crontabs. this file will be the name of the user who made that cron.
example if the user "osomabinladen" created a cron job then /var/spool/crontabs/osomabinladen file will be there. :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2005 06:36 PM
07-12-2005 06:36 PM
Re: How to shedule the job in crontab
Go to /usr/spool/cron/crontabs and do (as the user you want to execute this job):
$vi
In the file add:
00 22 * * * $HOME/scripts/
Save you work and quit. Verify the file as the apropriate permissions (at least read and write for the owner) and schedule it:
$crontab
Best Regards,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2005 06:38 PM
07-12-2005 06:38 PM
Re: How to shedule the job in crontab
Please go thru the steps ...
1. create a script file which you require to execute...
2. goto # cd /var/spool/cron/crontabs
3. edit root file # vi root
4. in this file put these entries
00 22 * * * /path of the script file
5. save and leave it , now it works fine...
here is the crontab help...
----- xxxx ----
the format to put in /var/spool/cron/crontabs/root file :
minute hour monthday month weekday command
-----xxxx -----
minute The minute of the hour, 0-59
hour The hour of the day, 0-23
monthday The day of the month, 1-31
month The month of the year, 1-12
weekday The day of the week, 0-6, 0=Sunday
files :
/var/adm/cron Main cron directory
/var/adm/cron/cron.allow List of allowed users
/var/adm/cron/cron.deny List of denied users
/var/adm/cron/log Accounting information
/var/spool/cron/crontabs Directory containing the crontab files
Hope this helps you.....
regds
Venkatesan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2005 09:59 PM
07-12-2005 09:59 PM
Re: How to shedule the job in crontab
Only root user can use the crontab command, but to give pemission to users to use the crontab command for scheduling the jobs there should be the entery of the users in /var/adm/cron/cron.allow file. So first of all make sure that you are root or a regular user, if you are root then ok otherwise put the name of that user in /var/adm/cron/cron.allow.
Now to use the cron just give a command 'crontab -e' it will open you a temporary file in vi editor there you make you cron entry and save the file. As you save the file cron saves this temporary file in /var/spool/cron/crontabs directory by the username who is giving 'crontab -e' command.
If you are root then you will get this file as /var/spool/cron/crontabs/root. If you are a regular user lets take it as user1 then this file be as /var/spool/cron/crontabs/user1.
So this is how you can cron a job.
And to see your cron scheduled jobs just give 'crontab -l' command it will show you your scheduled jobs.
Regards,
Manoj