Cron problem

  • Creator
    Topic
  • #49656
    Tim Hallbauer
    Participant

    Hey Guys and Gals,

    Our Admin is out and I am trying to trouble shoot a bigger problem so I wrote a simple script that just starts a connection. I am trying to execute it from root’s cron. It executes fine when I just execute the script from the command line. I saw all the stuff about setting the environment variables, but then read that if you su – hci those should be set? Can anyone tell me what’s going on here? Any help would be appreciated as I have been fighting with this for some time now.

    Cron entry

    35 12 * * * 1,2,3,4,5 su – hci “-c /cloverleaf/qdx5.4.1/integrator/scripts/start_cer_law_usage”

    Error message in root’s mail

    Subject: Cron 1,2,3,4,5 su – hci “-c /cloverleaf/qdx5.4.1/integrator/scripts/start_cer_law_usage”

    X-Cron-Env:

    X-Cron-Env:

    X-Cron-Env:

    X-Cron-Env:

    X-Cron-Env:

    /bin/sh: line 1: 1,2,3,4,5: command not found

    Thanks,

    Tim

Viewing 2 reply threads
  • Author
    Replies
    • #62894
      Scott Lee
      Participant

      Cron is expecting the 6th argument to be the start of the command.  It looks like you have too many asterisks and it is trying to execute the command ‘1,2,3,4,5’.

      Scott

    • #62895
      Robert Milfajt
      Participant

      Scott is right.  Here is an excerpt from the man page on crontab.

      The crontab File Entry Format

      A crontab file contains entries for each cron job. Entries are separated by

      newline characters. Each crontab file entry contains six fields separated by

      spaces or tabs in the following form:

      minute  hour  day_of_month  month  weekday  command

      These fields accept the following values:

      minute 0 through 59

      hour 0 through 23

      day_of_month 1 through 31

      month 1 through 12

      weekday 0 through 6 for Sunday through Saturday

      command a shell command

      Hope this helps,

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #62896
      Tim Hallbauer
      Participant

      Thanks guys. That did the trick. Sometimes another set of eyes comes in handy.

Viewing 2 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10