Celeb Glow
general | March 04, 2026

How to schedule a cron job to run every tuesday between specific dates of every month?

I want to run my cron job at 4 AM on every Tuesday between 4th and 24th of every month. Can someone help me with this. It shouldnt run outside the 4-24 range. Inside this range, it should run only on Tuesdays. For example for the month of April 2019, I want my job to run only on 9th, 16th and 23rd. Any help would be much appreciated. The OS is Ubuntu 16.04.4 LTS

1 Answer

You can achieve this by using a simple cron job that runs each day on the 4-24th

0 4 4-24 * * /bin/foo

with a condition to test for Tuesday.

[ "$(date '+%a')" = "Tue" ]

Combining this you have:

0 4 4-24 * * [ "$(date '+\%a')" = "Tue" ] && /bin/foo
0

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