LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crontab queries (https://www.linuxquestions.org/questions/linux-newbie-8/crontab-queries-4175542352/)

LYC 05-12-2015 06:21 AM

crontab queries
 
Hi,

Is it possible to schedule a cron job runs every quarter of the year? If so, how to go about it?

Thanks in advance.

TenTenths 05-12-2015 07:54 AM

Do you mean EXACTLY 1/4 of the year?

If you mean like on the 1st of the month each quarter then why not just specify the four months in the month field, e.g.

Code:

00 00 01 1,4,7,10 * /path/to/whatever

arizonagroovejet 05-12-2015 03:17 PM

One problem with your question is that a year isn't a fixed length.

If you went with the average length of a year, 365.242 days, turn that in to hours and divide by four and round down, you get 2191. So run the cronjob every 2191 hours

Code:

0 */2191 * * * cmd
This is almost certainly not what you want.

Unless what you want is what TenTenths suggested then you need to rephrase your question.


All times are GMT -5. The time now is 10:09 PM.