LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2015, 06:21 AM   #1
LYC
Member
 
Registered: Jan 2014
Posts: 109

Rep: Reputation: Disabled
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.
 
Old 05-12-2015, 07:54 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
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
 
Old 05-12-2015, 03:17 PM   #3
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Problem with crontab:: command not executed properly via crontab Ankush Seth Linux - Newbie 11 11-11-2013 06:25 AM
DIff B/w Crontab -l & crontab -e Tareq9959 Linux - Newbie 2 05-14-2013 08:27 AM
linux crontab vs unix crontab ytd Linux - General 2 08-09-2009 05:07 AM
replaced crontab, now should get crontab back to what it was raminn Linux - Newbie 2 10-20-2008 07:15 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration