Multiple Interval cron issue with order of execution


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Multiple Interval cron issue with order of execution
# 1  
Old 11-22-2011
Multiple Interval cron issue with order of execution

55,0 5,6 * * * myScript

This cron task will execute on 5:00AM, 5:55AM, 6:00AM and 6:55AM.

Is there any possibility to make it run only in the order specified
such as 5:55AM and 6:00AM (basically only on the 2 intervals) ?
# 2  
Old 11-22-2011
I doubt whether we can restrict that way in crontab... However, you can always put a check inside your script like this
Code:
test $(date +%H:%M) == "05:00" || test $(date +%H:%M) == "06:55" && exit 0

--ahamed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Order of execution of instructions in a script shell

Hi all, Here is a portion of my script test.sh: #!/bin/bash tar -cf $name.tar $name && pbzip2 $name.tar 2-Sending .tar.bz2 to destination node Please, i have a question. The execution of the second instruction is done, but i do not see the result of pbzip2 I have to send this... (2 Replies)
Discussion started by: chercheur111
2 Replies

2. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

3. Shell Programming and Scripting

Script Execution Order

Hi, I have two scripts which are mentioned in execute.sh more execute.sh ./script1.sh //line 1 should not return error ./script2.sh //line 2 may return error ./script2.sh //line 3 should not return error Condition: I want script1.sh to complete before starting script2.sh... (1 Reply)
Discussion started by: mohtashims
1 Replies

4. UNIX for Advanced & Expert Users

Order of execution seem to be reversed with pipe

Hello I am seeing a weird behavior during the execution of the shell program. The shell programs loops through a file which has a list of files. for each file the programs cats the file, pipes the output to sed command and then on to an awk program. But while execution, the order of... (3 Replies)
Discussion started by: vamxdir
3 Replies

5. UNIX for Dummies Questions & Answers

Searching for multiple words on a line in any order issue

Hi again I have figured out how to be able to sort through lines in a file with multiple words in any order and display them using this command: cat file | grep -i $OPTION1 | grep -i $OPTION2 | grep -i $OPTION3 OPTION1 is 2008, OPTION2 is Mar, OPTION 3 is Tue Result: Tue Mar 25... (4 Replies)
Discussion started by: semaj
4 Replies

6. UNIX for Advanced & Expert Users

How to set the SGE job execution order for nested qsub?

Dear All I am trying to write a script to set the SGE job execution order. I named each job with 'job1', 'job2' and 'job3'. I want my script to do: When 'job1' execution is complete, 'job2' is executed; when both 'job1' and 'job2' are complete, 'job3' is executed. First, I tried this... (0 Replies)
Discussion started by: cliffyiu
0 Replies

7. Shell Programming and Scripting

Selective input passing, for cron with multiple interval

0,0 4,5 11 11 * /pkgs/roots/scripts/job_monitor.ksh i have the requirement like, for the first time(4) the script should have the input parameter as "Value1" but the second time(5) it should have the input parameter as "Value2" Can we achieve this using any cron options ? If yes, How..??... (2 Replies)
Discussion started by: vikram3.r
2 Replies

8. Shell Programming and Scripting

Expect Issue Serial Forground Execution vs Concurrent Background Execution

I have an expect script that interrogates several hundred unix servers for both access and directories therein using "ssh user@host ls -l /path". The combination of host/path are unique but the host may be interrogated multiple times if there are multiple paths to test. The expect script is run... (2 Replies)
Discussion started by: twk
2 Replies

9. Solaris

Program execution order like FIFO queue

Hi all: I have a problem with a C++ service runing on solaris 10. This service only set a signal on oracle table. When the service detect a cut off on the line (tcp/ip), trigger a cobol program for set the signal OFF. When the line is on again, the service trigger the same cobol program for set... (0 Replies)
Discussion started by: hcastellani
0 Replies

10. Shell Programming and Scripting

Cron job for wekkly interval

Hi, I would like to trigger a scipt on every Wednesday 12:00PM. how can schedule this script in CRON command. Could you please help me on this. (3 Replies)
Discussion started by: koti_rama
3 Replies
Login or Register to Ask a Question