Go Back   Linux Forums by TotalPenguin! Get linux Help! > Linux > Linux General

Linux General Any questions that are not covered by other forums go here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-01-2008, 12:46 PM
Senior Member
 
Join Date: Jan 2007
Posts: 109
Hektor is on a distinguished road
Default In Crontab

In Crontab when does this execute:

Code:
58 23 1 * * <command>
How do I make it execute on the 1st and 15th? And what do each of the numbers/* mean?
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-02-2008, 11:05 PM
Tor Tor is offline
Senior Member
 
Join Date: Oct 2007
Posts: 390
Tor is on a distinguished road
Default

That executes at 23:58 on the first of every month (thats in 24 hours time so 11:58pm). You can make it execute on the 1st and 15th by using this:

Code:
58 23 1,15 * * <command>
See the 1,15? The comma makes it use different days. So you could do 1,2,3,15,20,25 as many as you like.

The * mean:

* * * * *
Min Hour Day Month dunno about this one.. Year I guess. hehe.
Reply With Quote
  #3 (permalink)  
Old 04-04-2008, 01:55 AM
Senior Member
 
Join Date: Jan 2007
Posts: 109
Hektor is on a distinguished road
Default

Ah, so it is delimited by spaces and commas allow multiple values.
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 05:43 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2006
Posts: 570
Jordan is on a distinguished road
Default

It isn't year it is:


field allowed values
----- --------------
minute...........0-59
hour..............0-23
day of month..1-31
month...........1-12 (or names, see below)
day of week...0-7 (0 or 7 is Sun, or use names)

Options
Instead of the first five fields, one of eight special strings may
appear:

string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".

Examples

# run five minutes after midnight, every day
5 0 * * * $HOME/bin/daily.job >> $HOME/tmp/out 2>&1
# run at 2:15pm on the first of every month -- output mailed to paul
15 14 1 * * $HOME/bin/monthly
# run at 10 pm on weekdays, annoy Joe
0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"



5 4 * * sun echo "run at 5 after 4 every sunday"
This comes out of the man page for cron.
Reply With Quote
Reply

Tags
crontab

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:22 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.