LinuxQuestions.org
Visit Jeremy's Blog.
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 01-14-2008, 01:20 PM   #1
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Rep: Reputation: 31
Is there a way to view what times cron jobs will run?


I use cron for a lot of jobs but don't set them up frequent enough to remember all the time.

is this going to run at 20 minutes every 8 hours or 8 time a day?

20 */8 * * *


Is there a way to validate this against cron and have it return the specific times that will run on?
 
Old 01-14-2008, 01:29 PM   #2
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,178

Rep: Reputation: 49
You could easily write a script to read the crontab entry and let you know what time said script would run.

*/x will run every X division of the time frame it appears in -- so in your example 20 */8 will run in the 20th minute every 8 hours of every day (so 8am, 4pm, 0am), unless I'm misreading it.

Obviously the man page has the full list of what is possible with crontab, but it'd be an interesting project nevertheless to write a script letting you know when every entry in your crontab (especially if you have a few hundred entries) would run, to give as a report to someone else, for example. I do not believe cron has such a tool natively, as anyone who should have interest thereby should be able to read the file.
 
Old 01-14-2008, 01:58 PM   #3
steve02169
Member
 
Registered: Feb 2007
Location: Quincy, MA USA
Distribution: Fedora Core 6
Posts: 96

Rep: Reputation: 15
Quote:
Originally Posted by MikeyCarter View Post
I use cron for a lot of jobs but don't set them up frequent enough to remember all the time.

is this going to run at 20 minutes every 8 hours or 8 time a day?

20 */8 * * *


Is there a way to validate this against cron and have it return the specific times that will run on?
You may want to consider installing kcron until you're comfortable without it. (Assuming you have a Window Manager,) It provides a graphic display for cron.
 
Old 01-14-2008, 02:02 PM   #4
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 448

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by steve02169 View Post
You may want to consider installing kcron until you're comfortable without it. (Assuming you have a Window Manager,) It provides a graphic display for cron.
I use Gnome. Is there a kcron equivalent for gnome?
 
Old 01-15-2008, 08:37 PM   #5
steve02169
Member
 
Registered: Feb 2007
Location: Quincy, MA USA
Distribution: Fedora Core 6
Posts: 96

Rep: Reputation: 15
Quote:
Originally Posted by MikeyCarter View Post
I use Gnome. Is there a kcron equivalent for gnome?
I hadn't thought so, but a search on Ubuntu forums brought up gcrontab which seems to be the equivalent.

http://www.arquired.es/users/aldelgado/proy/gcrontab/

If you try it could you post the results?

BTW, I often run kde apps in gnome and gtk apps in KDE. Just wanted to point that out if you didn't know you can, but I'm sure gcrontab will look better in gnome and would keep you from having to install KDE libraries if you don't use KDE.
 
Old 01-16-2008, 05:58 PM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Bookmark this cron guide/cheatsheet: http://www.adminschoice.com/docs/cro...Crontab%20file
 
Old 01-17-2008, 01:45 AM   #7
steve02169
Member
 
Registered: Feb 2007
Location: Quincy, MA USA
Distribution: Fedora Core 6
Posts: 96

Rep: Reputation: 15
Nice. Better than man or info pages IMHO. I may just build an OSS alarm clock yet.
 
  


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
X apps fail when run from cron jobs ericcarlson Linux - Software 4 05-31-2009 05:26 PM
running cron jobs at random times fakie_flip Linux - Software 1 11-23-2007 05:32 PM
How to run jobs in /etc/cron.daily? Micro420 Linux - Newbie 4 10-19-2006 02:07 PM
Cron jobs, will they run when not logged in? nextekcarl Linux - General 18 03-30-2004 10:28 AM
View/Stop and and all cron jobs? Tenover Linux - General 19 11-25-2003 01:53 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration