LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 12-06-2014, 08:22 PM   #1
charlemagne-is-my-son
Member
 
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


Code:
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
Thanks!

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

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

Code:
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
 
  


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:10 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
Open Source Consulting | Domain Registration