The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How do I set my date in a unix script to 'new month Agent704 UNIX for Dummies Questions & Answers 1 01-27-2008 09:58 AM
problem in script involving month arithmetic rajarp UNIX for Dummies Questions & Answers 6 01-02-2008 08:25 AM
Check if a day eg: saturday is the Last saturday of the month! jobbyjoseph Shell Programming and Scripting 9 12-21-2006 11:28 PM
Execute a script on 4 week of the month tbdo88 Shell Programming and Scripting 1 09-30-2006 09:08 AM
Script for tar and zip based on month & year tuxfello Shell Programming and Scripting 1 09-07-2006 08:52 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-06-2008
Registered User
 

Join Date: Feb 2008
Posts: 6
Stumble this Post!
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 ?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-06-2008
Registered User
 

Join Date: Sep 2006
Location: Mysore, India
Posts: 155
Stumble this Post!
You may get some help here
Reply With Quote
  #3 (permalink)  
Old 05-06-2008
Dave Miller's Avatar
Registered User
 

Join Date: Dec 2007
Location: Northern NJ, USA
Posts: 145
Stumble this Post!
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.
Reply With Quote
  #4 (permalink)  
Old 05-08-2008
Registered User
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 187
Stumble this Post!
Quote:
Originally Posted by sourabhsharma View Post
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
Reply With Quote
  #5 (permalink)  
Old 05-08-2008
Registered User
 

Join Date: May 2008
Location: Northern Ireland
Posts: 14
Stumble this Post!
00 23 8-14 * 6

Rgds
zx
Reply With Quote
  #6 (permalink)  
Old 05-09-2008
Dave Miller's Avatar
Registered User
 

Join Date: Dec 2007
Location: Northern NJ, USA
Posts: 145
Stumble this Post!
Quote:
Originally Posted by zxmaus View Post
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0