Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5952

Crontab to run on specific dates in specific months

$
0
0

I'm using crontab via DigitalOcean to run scheduled crons and I've got a number set up and working correctly. However, I'm in need of running one with the following schedule:

8am on 1st, 7th, 10th and 12th of January, April, July, October, November and December

Right now I've got it running every day and the code is checking if the current date matches the schedule I have but I think it would be better if the schedule is set up in crontab instead:

0 8 * * * /usr/bin/php /var/www/crons/file-to-run.php

Can anyone help me convert the above to the schedule I'd like?

UPDATE: I've used crontab guru to try and figure this out, I've come up with this:

0 8 1,7,10,12 1,4,7,10,11,12 * /usr/bin/php /var/www/crons/file-to-run.php


Viewing all articles
Browse latest Browse all 5952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>