- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how to schedule the work in every two hours
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
09-17-2004 09:59 PM
09-17-2004 09:59 PM
thanks very much
frederick
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2004 11:23 PM
09-17-2004 11:23 PM
Solutionto edit do crontab -e
add the following lines
00 2 * * * /usr/bin/df >> t.t
00 4 * * * /usr/bin/df >> t.t
00 6 * * * /usr/bin/df >> t.t
00 8 * * * /usr/bin/df >> t.t
00 10 * * * /bin/df >> t.t
00 12 * * * /bin/df >> t.t
00 14 * * * /bin/df >> t.t
00 16 * * * /bin/df >> t.t
00 18 * * * /bin/df >> t.t
00 20 * * * /bin/df >> t.t
00 22 * * * /bin/df >> t.t
00 00 * * * /bin/df >> t.t
this will run df every two hour and save output to file.
hope this not very usefull example will help you out.
J-P (Jean-Pierre)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2004 11:27 PM
09-17-2004 11:27 PM
Re: how to schedule the work in every two hours
In the crontab file the first lines should read
/bin/df
like in the last lines.
Please No points for this reply !
J-P (Jean-Pierre)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2004 12:01 AM
09-18-2004 12:01 AM
Re: how to schedule the work in every two hours
Acording to the crontab (5) man page the crontab entry can be:
0 0-23/2 * * * your2hourCommand
or
0 */2 * * * your2hourCommand
or
0 0,2,4,6,8,10,12,14,16,18,20,22 * * * your2hourCommand
I tested all 3 variants on the first field (minute) and they work.
Dont forget to finish the line with a new line! It seems that cron ignore lines which are not terminated by a linefeed
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2004 05:32 PM
09-19-2004 05:32 PM
Re: how to schedule the work in every two hours
0 0,2,4,6,8,10,12,14,16,18,20,22 * * *
where
first field indicates minute's
second one for hour setting
Example:
0 0,2,4,6,8,10,12,14,16,18,20,22 * * * date 1> /tmp/date_check 2>&1
* indicates that it will do in every day, every week-day and every month day's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2004 09:04 PM
09-19-2004 09:04 PM
Re: how to schedule the work in every two hours
00 */2 * * * myjob
It will then run at odd hours.
If you want it to run at even hours, use :
00 1-23/2 * * * myjob
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2004 02:29 AM
09-21-2004 02:29 AM
Re: how to schedule the work in every two hours
Hello
Well you can do your job for every 2 hours using the cron.For this u can do the following in your command prompt:
#crontab -e
* */2 * * * /PATH/TO/COMMAND > /dev/null 2>&1
Now your job will be done for every 2 hours/
More can be available at:
#man 5 crontab
Regards,
Senthil Murugan