Find the answer to your Linux question:
Results 1 to 3 of 3
Hi I'm new here and just started using Linux. I need to use it for my university course but I've started to like it, and I'm enjoying learning about it. ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    1

    Crontab Entries

    Hi I'm new here and just started using Linux. I need to use it for my university course but I've started to like it, and I'm enjoying learning about it. I am using my university notes to help me and I came across an example crontab entry that looks like this

    0,30 20 * * 1 cat /var/log/syslog.1.gz >> /root/syslogs.gz


    I read the manual on crontab and from what I gathered the format is the minute then hour, so I wonder why the example says 0,30. Would that be 12:30? Sorry for being such a newbie but the only way I can interpret the above crontab entry is that every January 20th, at 12:30 the contents of var/log/syslog.1.gz is appended to syslogs.gz in /root/syslogs.. I know I must be way off... any help appreciated. Also any ideas what the stars represent?

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    1,939
    The time entries are as follows starting at left (minutes, ...)
    | | | | |
    | | | | +----- day of week (0 - 6) (Sunday=0)
    | | | +------- month (1 - 12)
    | | +--------- day of month (1 - 31)
    | +----------- hour (0 - 23)
    +------------- min (0 - 59)

    The entry you have would run at 8:00pm and 8:30pm every Monday. The first entry "0/30" with the "/" means both at the top of the hour and 30 minutes past. Probably be easier to find out about cron by googling it as there are a large number of tutorials on it.

  3. #3
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    yancek,

    Actually his sample is 0,30 and not 0/30. His sample, which is using the comma, is specifying a list of minutes, 00 & 30. Yours, which is using the forward slash, specifies start at minutes 0 and step by 30. Both, in this case, produce the same results which is to run the command at 8:00 PM & 8:30 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...