LinuxQuestions.org
Review your favorite Linux distribution.
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, 07:21 AM   #1
LYC
Member
 
Registered: Jan 2014
Posts: 100

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, 08:54 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,166

Rep: Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751Reputation: 751
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, 04:17 PM   #3
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,078

Rep: Reputation: 195Reputation: 195
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:25 AM
DIff B/w Crontab -l & crontab -e Tareq9959 Linux - Newbie 2 05-14-2013 09:27 AM
linux crontab vs unix crontab ytd Linux - General 2 08-09-2009 06:07 AM
replaced crontab, now should get crontab back to what it was raminn Linux - Newbie 2 10-20-2008 08:15 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 01:35 PM


All times are GMT -5. The time now is 02:52 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration