Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to run 1st Monday of every month

Status
Not open for further replies.

SiouxCityElvis

Programmer
Jun 6, 2003
228
0
0
US
How do I set my crontab to run a process 1st Monday of every month?

Thanks.

-Programmer dummy
 
* * 1-6 * 1 command...

Min all (change to suit)
Hour all (change to suit)
Mday day of month of execution, 1-6 = first week
Month all
Wday day of week of execution, 1=monday

 
Hi,

according to my man pages lgarner's solution will run the script the first 6 days of each month and on every Monday.
Afaik you cannot do what you want just by specifying dates in crontab.
But you could run a script every Monday, which first checks whether the day is greater than 7. If so, exit; otherwise execute your code.

regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top