Results 1 to 7 of 7

Thread: Cron Help Needed

  1. #1
    Junior Member
    Join Date
    Apr 2005
    Posts
    10

    Cron Help Needed

    I have created a basic crontab in Solaris 8 , shown below

    * * * * * date

    Within the /var/cron/log I am getting the following error:

    > CMD: date
    > smuser 5904 c Wed Jun 22 12:49:00 2005
    < smuser 5904 c Wed Jun 22 12:49:00 2005
    exec failed. errno=2.

    The above crontab was made simple to see if my real crontab was not defined correctly. But ofcourse it does not make a difference.

    I have searched google.

    Any thoughts?

  2. #2
    Jaded Network Admin nebulus200's Avatar
    Join Date
    Jun 2002
    Posts
    1,356
    Could you humour me and try a different command ? For example :


    5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/sbin/ntpdate time.xmission.com


    (note, if you want to keep this entry, would recommend backing off of the timing from every 5 minutes to maybe every 12 hours). I am thinking that either the program is returning a code of 2 (hence the error) or possibly there is a problem with the command you are trying to issue.

    Don't forget to SIGHUP cron when you change it. Also, the cron job itself...are you doing a root cron job or are you trying to use a less privelaged user (that can make a difference and there are other things you have to do) ?

    There is only one constant, one universal, it is the only real truth: causality. Action. Reaction. Cause and effect...There is no escape from it, we are forever slaves to it. Our only hope, our only peace is to understand it, to understand the 'why'. 'Why' is what separates us from them, you from me. 'Why' is the only real social power, without it you are powerless.

    (Merovingian - Matrix Reloaded)

  3. #3
    Junior Member
    Join Date
    Apr 2005
    Posts
    10
    I have tried other commands. I was just using one that was pretty basic.

    The command that I am running is:
    5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/netegrity/siteminder/policy_bkups/smuser

    The script runs fine, if ran manually.

    I am using a less privelaged account. I have added the account into the /etc/cron.d/cron.allow and verified that the account did not exist in the /etc/cron.d/cron.deny.

    I have never had this much difficulty before.

    Thanks

  4. #4
    Jaded Network Admin nebulus200's Avatar
    Join Date
    Jun 2002
    Posts
    1,356
    Sounds like you have the cron side set up right. Could it possibly be an environment variable issue ? Ie, if you are in an interactive shell a necessary env var is set (env), but it isn't set when cron is trying to run it ? Are any of your cron jobs working ?
    There is only one constant, one universal, it is the only real truth: causality. Action. Reaction. Cause and effect...There is no escape from it, we are forever slaves to it. Our only hope, our only peace is to understand it, to understand the 'why'. 'Why' is what separates us from them, you from me. 'Why' is the only real social power, without it you are powerless.

    (Merovingian - Matrix Reloaded)

  5. #5
    Junior Member
    Join Date
    Apr 2005
    Posts
    10
    None of the scripts I have tried are working. There are some owned by root that are.

    I was thinking that it may be an environment issue but that is why I was trying to just run "date" since that should not need a specific variable.

    Thanks

  6. #6
    Jaded Network Admin nebulus200's Avatar
    Join Date
    Jun 2002
    Posts
    1,356
    Try taking what environment variables are defined in your interactive shell (env) and putting them in /etc/default/cron. I am wanting to say this is where you can set variables for the cron environment, if that fails try putting them in /etc/profile.
    There is only one constant, one universal, it is the only real truth: causality. Action. Reaction. Cause and effect...There is no escape from it, we are forever slaves to it. Our only hope, our only peace is to understand it, to understand the 'why'. 'Why' is what separates us from them, you from me. 'Why' is the only real social power, without it you are powerless.

    (Merovingian - Matrix Reloaded)

  7. #7
    Junior Member
    Join Date
    Apr 2005
    Posts
    10
    It made no difference.

    Thx

Posting Permissions

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