Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-06-2014, 09:22 PM   #1
Registered: Dec 2012
Location: Shanghai
Distribution: Xubuntu, 14.04
Posts: 54

Rep: Reputation: Disabled
In crontab, how can I schedule a command for every x months or every other DOW

From what I read here, I tried setting up some cron jobs using these slashes, but I'm really not sure if I did it properly. I could just wait until the desired days roll around, but I'm impatient.

1st line: every other Sun at 11am
2nd: first day of every month at 11am
3rd: 3rd day of every three months at 11am
4th: everyday at 10pm
5th: every Sun at 11am

0 11 * * 0-6/6 libreoffice /home/matias/Documents/projects/exercise/body-measurements.xlsx
0 11 1 * * gedit /home/matias/Documents/projects/fitness/fish-oil-buy-reminder.txt
0 11 3 */3 * gedit /home/matias/Documents/projects/fitness/off-caffeine.txt
0 22 * * * gedit /home/matias/Documents/daily-accomplishments.txt
0 11 * * Sun gedit /home/matias/Documents/computer-specific/firefox-backup-reminder.txt

Last edited by charlemagne-is-my-son; 12-06-2014 at 09:24 PM.
Old 12-06-2014, 11:53 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
0 11 1 6,12 * gedit /home/matias/Documents/projects/fitness/fish-oil-buy-reminder.txt
This should run at the first minute of the eleventh hour on the first day of the month, for months 6 and 12 (notice the month numbers with comma seperator: no spaces). If this fails, try replacing gedit with the full path to gedit: /usr/bin/gedit.

0 11 *  * 0,2,4,6 gedit /home/matias/Documents/projects/fitness/fish-oil-buy-reminder.txt
This should run on the first minute of the eleventh hour on days Sun, Tue, Thur, and Sat.

Crontab tutorial


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] crontab schedule santosh0782 Linux - Newbie 2 03-30-2014 02:35 AM
[SOLVED] crontab schedule JJJCR Linux - Newbie 3 04-11-2012 05:11 AM
schedule a crontab rupesh_pulikool Solaris / OpenSolaris 7 09-04-2004 10:32 PM
crontab schedule help onlykims Linux - Newbie 2 08-28-2004 01:09 PM
Schedule TOP command in Crontab. imsajjadali Red Hat 2 05-20-2004 05:12 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:50 PM.

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