How to scedule a script to be run on every second saturday in Month?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to scedule a script to be run on every second saturday in Month?
# 1  
Old 05-06-2008
How to scedule a script to be run on every second saturday in Month?

Hello Friends,

In my project I have to schedule a script to be run on every second saturday (once in month). Can you please suggest what entry should I make in cron ?
# 2  
Old 05-06-2008
You may get some help here
# 3  
Old 05-06-2008
cron combines days with dates, using or logic rather than and.

The short answer is this: Have it run every Saturday, then have your script check if the date is 8-14.
# 4  
Old 05-08-2008
Quote:
Originally Posted by sourabhsharma
Hello Friends,

In my project I have to schedule a script to be run on every second saturday (once in month). Can you please suggest what entry should I make in cron ?
Hey,

It depends that on which date "Second Saturday" comes in a particular month.
Make a cron job entry with following parameters :
00 23 ? * 6

This is at 00 minutes of hour 23 on Saturday Every Month execute the script. But ? denotes "Which Day of the Month" : this varies and as I said earlier "It depends that on which date 'Second Saturday' comes in a particular month."
Either you program it OR Fix the day of the month as 14th day of the month.

Then cron entry will be :
00 23 14 * 6


Hope you got what I am trying to convey.
Thanks.
Varun Smilie
# 5  
Old 05-08-2008
00 23 8-14 * 6

Rgds
zx
# 6  
Old 05-09-2008
Quote:
Originally Posted by zxmaus
00 23 8-14 * 6
OK. I'll repeat myself.

cron uses or logic regarding dates and days.

Therefore, the above suggestion will run the job at 11:00pm, every day from the 8th to the 14th, as well as every Saturday.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Run script on every last sunday of the month

Hi ALL, I have been testing this script to run for every last Sunday of the month,looks like month which have 5 sunday (july 2016 )is not passing this and failing every time. Here is what I am using, current_date=31 echo " CURRENT DAY -> $current_date" if ... (2 Replies)
Discussion started by: netdbaind
2 Replies

2. Shell Programming and Scripting

Script to run on 2 4 and 7 day of the month

I am looking for a unix script which could run a job on 2, 4 and 7 working day of the month. if the days are falling on the saturday/sunday. it should run on the next day. Thank you.. (9 Replies)
Discussion started by: tradingspecial
9 Replies

3. Shell Programming and Scripting

Run shell script alternate week per month

Hi All, Requirement :- I have shell script in kern shell ,have to run alternate week per month example-today's date is 27 Mar 2013 and my script will run today then for the next time when it will run it should check 1st what was the last run date(27 Mar 2013) if it is matched 15days from... (2 Replies)
Discussion started by: krupasindhu18
2 Replies

4. Shell Programming and Scripting

Scheduling on every 2nd Saturday of a Month

Hi ! I need ur help on a UNIX scheduling Concept understanding : If I need to schedule a job (Say ETL Datastage job) through a shell script using the Cron function to make it run on every second saturday of every month, How can I do it ? :confused: (2 Replies)
Discussion started by: Ravichander
2 Replies

5. Shell Programming and Scripting

cron to get executed on 2nd and 4th saturday of every month

Hi , i need to reboot a server during 2nd and 4th saturday every month. i have come up with the below cron 30 17 8-14 * * if ; then /rebootscript; fi # to reboot every second saturday 30 17 22-28 * * if ; then /rebootscript; fi # to reboot every fourth saturday I am wondering why it... (3 Replies)
Discussion started by: chidori
3 Replies

6. Shell Programming and Scripting

Run cron on every second Saturday ??

Hi, Can anyone help in editing CRON (OR) write a script to run another script every second saturday?? I tried to make use of DATE command to find the day but couldnt proceed further. your help is highly appreciated! Thanks, Mahi (11 Replies)
Discussion started by: mahi_mayu069
11 Replies

7. Shell Programming and Scripting

run the script on every 31st of month.....

Hello expert, I need a logic code {don't want to schedule into crontab} which can run some of my code on 31st of Jan, March, Mya, Aug, Oct, Dec..... Ex: if then echo "success" fi Please help me in achieving this Thanks (3 Replies)
Discussion started by: aks_1902
3 Replies

8. Shell Programming and Scripting

run the script for last day of the month

Hello Experts, I have a script which i want to run the on last day of every month. let say I have backup.sh script which i want to run it every month last day. Can anyone please help :confused: thanks (4 Replies)
Discussion started by: aks_1902
4 Replies

9. UNIX for Advanced & Expert Users

Run a script parallel for a month's worth:

Is there a utility that can be used in a shell script that would run a .sql file for 30 or 31 days in a month at the same time parallely. Please Advice. Thanks SD12. (2 Replies)
Discussion started by: sd12
2 Replies

10. Shell Programming and Scripting

Check if a day eg: saturday is the Last saturday of the month!

Hi, I need to develop a script to check for the day. If the day is a Saturday then the script should check if the Saturday is the last Saturday of the month so that certain set of instruction can be executed is it is the last Saturday. I do not want to use the crontab as this needs to be part... (9 Replies)
Discussion started by: jobbyjoseph
9 Replies
Login or Register to Ask a Question