Re: a problem on crontab time format



Thanks a lot. I just think it's at least a `weak' bug: Any crontab
item specifying the minute slot as `*' may be a potential disaster.


On Sun, Jan 23, 2011 at 00:32, elbbit <elbbit@xxxxxxxxx> wrote:
On 23/01/11 05:14, Kejia柯嘉 wrote:
On Sun, Jan 23, 2011 at 12:11 AM, Kejia柯嘉 <w.kejia@xxxxxxxxx> wrote:
How does the following crontab line run:
* 1 * * * * my_command
Every minute of every 1 o'clock? Or only once of every 1 o'clock?
Sorry, the crontab line is:
 * 1 * * * my_command


You need to understand how cron(8) matches the time code you set in the
configuration file.  To re-iterate the man page available with "man 5
crontab":

   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)

A field may be an asterisk (*), which always stands for ``first-last''.

So, using the above as a guide, I approximate a translation of your
configuration line as saying: "at every minute of the hour 1 on every
day of month and during every month and on every day of the week please
run command my_command"

Hope this helps.

--

elbbit


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/4D3BBD60.1030309@xxxxxxxxx




--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/AANLkTimThDbzcTbOUU-Ythbf9phBkjMX=MojqKrDWuQM@xxxxxxxxxxxxxx



Relevant Pages

  • Re: [OT] something about dropbox
    ... there was a finding that dropbox's configuration file was ... the other issue is that dropbox uses the same ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)
  • RE: Why this crontab does not work?
    ... Why this crontab does not work? ... apt-get upgrade -d ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)
  • Re: How do I make my normal account (not root) have administrative (root) privileges?
    ... Your display manager may be configured not to allow root logins. ... there may be a directive in the configuration file ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)
  • Re: backup script and python
    ... Included in crontab, just as shown in man 5 crontab ... >>BACKUP ZENOSS WITH TROUBLE - ERROR! ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: Illegal characters in cron
    ... |> | I'm having trouble getting the following to work in my ... person's ultimate good as far as it can be obtained. ... To UNSUBSCRIBE, email to debian-user-request@lists.debian.org ...
    (Debian-User)