Results 1 to 5 of 5

Thread: Problem with setting up Cron in RH 7.2

  1. #1
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Problem with setting up Cron in RH 7.2

    I was trying to set up a cron job on my Red Hat 7.2 box.

    The content is
    Code:
    */5**** /home/sysadmin/getmail
    But the system return the following error.
    Code:
    [root@supra cron.hourly]# crontab -u sysadmin -e
    no crontab for sysadmin - using an empty one
    crontab: installing new crontab
    "/tmp/crontab.9201":1: bad day-of-month
    errors in crontab file, can't install.
    Do you want to retry the same edit? 
    [root@supra cron.hourly]#
    What am I doing wrong?? If I want a cron job to wake up and do stuff every 15 minutes, what should I do? How to set up the cron?
    TIA

  2. #2

    Re: Problem with setting up Cron in RH 7.2

    as user, what i did was make a file (i used pico)

    "pico cronjob"

    */15 * * * * /program.to.run

    then save it

    "cron cronjob" as that same user

    that should be it
    the man file for cron is decent, too.... make sure you have the spaces between each asterice, the first non-spaced set is for minutes (*/15 means every fifteen minutes), the second means day (* is every day) the third is every week (* means each week) the last is month (* means every month)...i think those are right...but either way */15 * * * * means every fifteen minutes always

    also, make sure that you do "cron file.name.where.you.saved.*/15 * * * *"

  3. #3
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re: Problem with setting up Cron in RH 7.2

    Ah, got it nailed down. Thanks.

    "cron cronjob" as that same user
    When I use that command with "cron getmail", it wouldn't work. Then I did it with crontab -e, it works fine.
    make sure you have the spaces between each asterice, the first non-spaced set is for minutes (*/15 means every fifteen minutes), the second means day (* is every day) the third is every week (* means each week) the last is month (* means every month)...i think those are right...but either way */15 * * * * means every fifteen minutes always
    Okay. May be because I was using artisticks without any spaces .... :-[
    And thanks for your excellent explaination ...

  4. #4

    Re: Problem with setting up Cron in RH 7.2

    Must have spaces... spaces are our friend... without spaces,

    thisisn'tveryreadablewithoutspaces...thisiswhyspac esaregood,andweneedthem.

  5. #5
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re: Problem with setting up Cron in RH 7.2

    But I can read ... :P

Similar Threads

  1. cron job
    By pinehead in forum Linux - General Topics
    Replies: 1
    Last Post: 08-12-2004, 11:19 PM
  2. rsync+cron help
    By Ashcrow in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 05-05-2003, 01:46 PM
  3. cron keeps emailing me.
    By Blaqb0x in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 10-21-2002, 11:07 PM
  4. Help with Cron
    By Baldy in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 05-23-2002, 01:51 PM
  5. another cron problem
    By cameron in forum Linux - General Topics
    Replies: 7
    Last Post: 03-23-2002, 06:43 PM

Bookmarks

Posting Permissions

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