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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

first Tuesday of the month with cron 1

Status
Not open for further replies.

pjb

Programmer
May 1, 2001
148
0
0
US
I need to run a shell(test.sh)at 7:00AM on the first Tuesday of the month. will this work?:

00 07 1-7 * 2 test.sh
 
Looks right to me.

"That time in Seattle... was a nightmare. I came out of it dead broke, without a house, without anything except a girlfriend and a knowledge of UNIX."
"Well, that's something," Avi says. "Normally those two are mutually exclusive."
-- Neal Stephenson, "Cryptonomicon"
 
You cron job will run the first seven days of each month and each tuesday.
You may try something like this:
00 07 * * 2 [ `date '+\%d'` -le 7 ] && test.sh

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top