Is their any way to schedule a CRON Job, which triggers the script only on last Saturday of the month. Please advise.

1

1 Answer

One possibility might be to schedule the job to run every Saturday, but make execution of the actual command conditional on the month one week hence, ex.

0 9 * * 6 [ "$(date +\%b -d 'next week')" = "$(date +\%b)" ] || somecommand 

Note that the % character is special in crontabs, and needs to be escaped.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy