- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cron help
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
Discussions
Discussions
Forums
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
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
тАО02-02-2010 06:38 AM
тАО02-02-2010 06:38 AM
Re: Cron help
>>00 08 1-7,15-21 * 3 /home/oracle/test.sh
No, I don't think this will do what you want. This job will run on the 1-7, the 15-21 AND on Friday. The job will run IF ANY of the last 3 fields are true.
Note the example from the cron man page:
Note that the specification of days can be made in two fields: monthday and weekday. If both are specified in an entry, they are cumulative. For example,
0 0 1,15 * 1 command
runs command at midnight on the first and fifteenth of each month, as well as every Monday.
>>Do all months have exactly 28 days?
Well, yes they do! ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2010 06:45 AM
тАО02-02-2010 06:45 AM
Re: Cron help
> Well, yes they do! ;)
This must be some new meaning for the word
"exactly" (which I used for a reason).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2010 07:45 AM
тАО02-03-2010 07:45 AM
Re: Cron help
Thanks for everyone contributed.
Here is the logic, if anyone needs it.
This will run biweekly sunday at 10.00am.
My cron
--------
00 10 * * 6 /myscript
My script
---------
#! /usr/bin/bash
if [ -e /tmp/fchek ] ; then
rm -f /tmp/fchek
else
touch /tmp/fchek
exit 0
fi
sh /myscript
exit 0
Explanation : (Not for experts!)
-------------
Script will look for a file /tmp/fcheck on the first run, it wont find it and it will create and exit. On the next week it will find the file, remove it and execute my script. On third week it wont find my file, create it and exit and so on....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2010 07:46 AM
тАО02-03-2010 07:46 AM
Re: Cron help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2010 08:11 AM
тАО02-03-2010 08:11 AM
Re: Cron help
> else
If someone changes the permissions on this
file, then the "rm" could fail (silently).
Of course, this should never happen. How
important is it that this job run exactly
every two weeks? Sometimes the easy way is
good enough. Sometimes it's not. You get to
decide what's good enough.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2010 08:18 AM
тАО02-03-2010 08:18 AM
Re: Cron help
- « Previous
-
- 1
- 2
- Next »