Help with cron schedule

Thread Tools Search this Thread
Operating Systems HP-UX Help with cron schedule
# 1  
Old 09-09-2013
Bug Help with cron schedule

Hope you can help with a queuy i have. Server OS is HP-UX
my cron runs like this:

* * * * * /test/scripts/ 1>/dev/null 2>/dev/null
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /test/scripts/ 1>/dev/null 2>/dev/null
0,15,30,45 * * * * /test/scripts/ 1>/dev/null 2>/dev/null

I need to be able to stop them running (or change the cron so they do not run) at 19:45 on saturday until 8:05 on Sunday
for this year (2013)

he outage periods for the rest of 2013 are Sat 5th/Sun 6th October, Sat 9th/Sun 10th November, Sat 7th/Sun 8th December.

Any ideas how i schedule this as a cron that i can set and not need to look at it again?

# 2  
Old 09-09-2013
While possible in cron (with multiple entries to handle all the rules), I wonder if a better solution is to address the 'skip times' at the very beginning of the called program?
# 3  
Old 09-09-2013
I wonder if it could also work, that you use the at daemon to stop and start the cron daemon at the appropriate times?
# 4  
Old 09-09-2013

it would not be a bad idea to use 'at' if there was not other crons in use at that specific time. unfortunately these are all we are asked to halt. Any other ideas? cron examples?
# 5  
Old 09-09-2013
You could setup a new job (cron or at) to swap in an alternative cron file that omits / adds those entries, at the desired times. Alternatively you could do as joeyg suggests and fashion a load of cron entries to meet the requirement, or add a time check to each of the affected scripts.
# 6  
Old 09-09-2013
What about a at job that replaces the cronfile (removes the jobs...) and reload, then at end time of schedule an at job for restoring the cronfile and reload again ?
# 7  
Old 09-09-2013
Smilie You were faster than me Scott...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cron job is not running on schedule

Scheduled job is not running on time.but it is running when executing same command manually. 25 10 * * * /code/bin/ACCOUNT.ksh 1 >/dev/null 2 >&1 Manually executing the same Ksh -x /code/bin/ACCOUNT.ksh 1 >/dev/null 2 >&1 Followed steps Crontab -e Added the job to cron tab. (4 Replies)
Discussion started by: Myguest
4 Replies

2. Shell Programming and Scripting

schedule a job without Cron

Hi All, Is there any way (any utility) to schedule a job to run once in a week on RedHat Linux ? Note- Do not using Crontab. Thanks Pravin (1 Reply)
Discussion started by: pravin27
1 Replies

3. UNIX for Dummies Questions & Answers

Schedule a cron job

Hi, Can anyone help me out with scheduling a cron job for the below: i wnated to delete file from a folder on every sunday at 05:00 AM this is code i have used. ******************************************************* 0 05 * * 0 find /abc/xyz/pqrs/bak/ -type f -mtime +30 -exec rm -f... (5 Replies)
Discussion started by: ch33ry
5 Replies

4. Shell Programming and Scripting

Schedule a Cron job

Hi all, I am new to cron jobs.. i wanted to schedule a cron job that wil send a mail to me at 3:00PM on 10th August ie is on Wednesday. 0 15 10 8 3 echo "message from UNIX here"|mail -s "your subject here" However this was not executed... Can anyone please... (0 Replies)
Discussion started by: ch33ry
0 Replies

5. Shell Programming and Scripting

Schedule without cron

Hi, How to write the recursive function. I have a script, #!/usr/bin/ksh ## name=$1 outputfile='output.log' sqlplus -s > ${outputfile} <<__END__ ${USER}/${PASS}@${DB} WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK WHENEVER OSERROR EXIT FAILURE ROLLBACK SET ECHO ON SET SERVEROUTPUT... (3 Replies)
Discussion started by: sandy1028
3 Replies

6. Solaris

Prstat Cron Schedule

Hi , I am trying to set up a cron job for getting the prstats for every 10 minutes to a log file. prstat -s cpu -n 20 > a.txt The issue is when i try to execute this command, a.txt is filling up with data for every second which is not i wanted.I just need top 20 processes for every 10... (2 Replies)
Discussion started by: pyaranoid
2 Replies

7. UNIX for Dummies Questions & Answers

Cron schedule for ever other week

I have cron scheduing that after hotbackup omniback kicks in and back up tape. 00 17 * * * /usr/local/bin/archbakPRD/ > /usr/local/bin/archbakPRD/dbfcopy.log 2 >&1 above cron can fired every night at 5PM but omnibackup need to have seperate name for each backup ( i.e:... (1 Reply)
Discussion started by: Paul.S
1 Replies

8. Shell Programming and Scripting

unable to schedule in cron

the follwing script is running fine , when run from the ksh runs properly i.e. waits for a file "test.flag" and sends mail accordingly. But when I schedule it in the crontab does not run at the specified time (it never runs). I am using ksh ####shell script starts count=1... (4 Replies)
Discussion started by: ace@123
4 Replies

9. UNIX for Dummies Questions & Answers

schedule many jobs using cron

HI, I need to schedule a no.of jobs using the cron facility. I currently do two kinds of scheduling,one based on the database load(after the database is loaded the program will start) and the other is based on time.....(say 10.00a.m daily) the problem is.......... When the database is loaded... (1 Reply)
Discussion started by: sireesha15
1 Replies
Login or Register to Ask a Question