Crontab to skip only one entry in a day???


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab to skip only one entry in a day???
# 1  
Old 10-06-2010
Question Crontab to skip only one entry in a day???

Hello Friends,

I have a cron tab like this:

Code:
10,40 1-23 * * * /script

i want to skip only one execution at 00:10, so basically i want it to execute every hour at 10th and 40th minute, except 00:10.

Could anyone help me doing this

Thanks folks
Smilie

Last edited by Scott; 10-06-2010 at 07:19 PM.. Reason: Added code tags, removed formatting
# 2  
Old 10-06-2010
Hi.

Simple way:
Code:
10,40 1-23 * * * /script
40 0 * * * /script

# 3  
Old 10-06-2010
Thanks much

This way i have to go with two crons, was trying to figure out if thats possible with one cron?? Any ideas?
# 4  
Old 10-06-2010
Quote:
Originally Posted by Prateek007
Thanks much

This way i have to go with two crons, was trying to figure out if thats possible with one cron?? Any ideas?
if you need limit in one cron, then you have to update your script by add one if-then-else.

scottn's solution will help you to implement it without any updates in script.

Think about it, if one day you request is changed again, update the cronjob will be more easy.
# 5  
Old 10-06-2010
I hear you

Thanks for all your help guys, much appreciated Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Dynamic crontab entry for day and night

I have query apply crontab entry that the script executes as below day hours (before 8:00 PM and after 7:00 AM) execute every 5 min in Night hours (after 8:00 PM to 7:00 AM) executes every 15 min How can we set such entry in crontab ? (4 Replies)
Discussion started by: kaushik02018
4 Replies

2. Shell Programming and Scripting

Simpler crontab entry to execute pgm on last day of the month

The following bash command line works for the last day of the month. Test by replacing the 1 with tomorrows day of month number && echo "Day before tomorrow"Can it be used within crontab? As * * 28-31 * * && echo "Today ls last day of month" >>/tmp/crontabtestI tried to test crontab with... (1 Reply)
Discussion started by: lsatenstein
1 Replies

3. Shell Programming and Scripting

Search pattern on logfile and search for day/dates and skip duplicate lines if any

Hi, I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error. Unfortunately, this is not a fool proof script.... (2 Replies)
Discussion started by: newbie_01
2 Replies

4. Solaris

crontab entry

hi i am new in solaris. i am accessing server through putty. i could not add entry in crontab. i have given "crontab -e" for add a new entry. It is not coming. what parameter i have to set for getting crontab -e thanks (1 Reply)
Discussion started by: sunnybee
1 Replies

5. AIX

crontab entry

Hi. I'm new to AIX and I need to create a crontab entry to run a script every first 5 business days of the month? please help. (2 Replies)
Discussion started by: udelalv
2 Replies

6. Shell Programming and Scripting

crontab entry to run every last day of the month

i've created a script which should run every last day of the month. what would be the exact crontab entry for this? thanks! (9 Replies)
Discussion started by: tads98
9 Replies

7. Shell Programming and Scripting

Crontab Entry

Hi Everyone , have a nice day given below is the line i have added in crontab * * * * * /Rauf/script2.sh intended to run this script after every minute , when i run this script manually it runs fine and produces output , but after adding it to crontab ( like given above ) , it doesnt work ... (5 Replies)
Discussion started by: Dastard
5 Replies

8. UNIX for Advanced & Expert Users

crontab entry

Sometimes cron really upsets me and I cant figure out these types of wierd dates, but how do I get cron to run something on every other sunday? I am running Solaris 8. -S (4 Replies)
Discussion started by: Sowser
4 Replies

9. UNIX for Dummies Questions & Answers

crontab entry

hi all how to schedule a cron job running on last day of every third month at 12 midnight will the following work 0 0 30,31 3,6,9,12 * <required file> thanks (3 Replies)
Discussion started by: matrixmadhan
3 Replies
Login or Register to Ask a Question