1752815 Members
3954 Online
108789 Solutions
New Discussion

Re: Cron Job Issue

 
itrc55
Regular Advisor

Cron Job Issue

Hi,

 

Is there a way to set job to run first friday of every month at 12:00 am?

 

Thanks

4 REPLIES 4
Steven Schweda
Honored Contributor

Re: Cron Job Issue

 
itrc55
Regular Advisor

Re: Cron Job Issue

Hi,


Is there any way to schedule cron execution on every first friday each month ?

so far I'm using:
0 12 * * 5 /test.sh

but it's for every friday and shell handles this internally checking for existince some control files.

Thanks all.

Dennis Handly
Acclaimed Contributor

Re: Cron Job Issue

00 00 * * 5 /test.sh

 

>but it's for every Friday and shell handles this internally checking for existence some control files

 

As Steven said, you must check for the first Friday in your script:

if [ $(date +%e) -gt 7 ]; then

   exit 0

fi

Steven Schweda
Honored Contributor

Re: Cron Job Issue