Loading ...
Sorry, an error occurred while loading the content.

Re: [nslu2-general] Re: Problems with cron

Expand Messages
  • John
    ... Yes. PATH is an important one, e.g. export PATH=/bin:/usr/bin:/opt/bin:/usr/local/bin but change this to insert whatever path your script needs. Cron
    Message 1 of 10 , Aug 2, 2007
    • 0 Attachment
      > Should I set maybe any environment variable?

      Yes. PATH is an important one, e.g.

      export PATH=/bin:/usr/bin:/opt/bin:/usr/local/bin

      but change this to insert whatever path your script needs.

      Cron starts jobs with only specific environment variables set.
      Anything else that your job needs must be set explicitly. This is
      a security measure designed to prevent a hostile user from
      capturing control of someone else's cron job.
    • Daniel Berenguer
      ... John, I m using absolute paths in my crontab. Should I add the PATH variable anyway? Thanks, Daniel.
      Message 2 of 10 , Aug 2, 2007
      • 0 Attachment
        --- In nslu2-general@yahoogroups.com, John <jl.050877@...> wrote:
        >
        > > Should I set maybe any environment variable?
        >
        > Yes. PATH is an important one, e.g.
        >
        > export PATH=/bin:/usr/bin:/opt/bin:/usr/local/bin
        >
        > but change this to insert whatever path your script needs.
        >
        > Cron starts jobs with only specific environment variables set.
        > Anything else that your job needs must be set explicitly. This is
        > a security measure designed to prevent a hostile user from
        > capturing control of someone else's cron job.
        >

        John, I'm using absolute paths in my crontab. Should I add the PATH
        variable anyway?

        Thanks,

        Daniel.
      • John
        Daniel, ... Do the programs that you are running in crontab need the PATH variable in order to run other programs? Many unix programs call/run other unix
        Message 3 of 10 , Aug 2, 2007
        • 0 Attachment
          Daniel,

          > John, I'm using absolute paths in my crontab. Should I add the PATH
          > variable anyway?

          Do the programs that you are running in crontab need the PATH
          variable in order to run other programs? Many unix programs
          call/run other unix programs.

          The example you gave was /etc/syncdate. I don't know what
          that is but, from the name alone, it seems quite possible that its
          operation depends on being able to find another program in the path
          such as rdate or ntpdate or ntpd or similar.

          If things are set up right, any output from the cron job
          should be mailed to you. Do you get any error messages from the
          cron job?

          John
        • Daniel Berenguer
          ... Hi John. Setting PATTH makes no differrence so far. I m even testing with more simple crontabs and most of the times they don t work. Ex: SHELL=/bin/sh
          Message 4 of 10 , Aug 4, 2007
          • 0 Attachment
            --- In nslu2-general@yahoogroups.com, John <jl.050877@...> wrote:
            >
            > Daniel,
            >
            > > John, I'm using absolute paths in my crontab. Should I add the PATH
            > > variable anyway?
            >
            > Do the programs that you are running in crontab need the PATH
            > variable in order to run other programs? Many unix programs
            > call/run other unix programs.
            >
            > The example you gave was /etc/syncdate. I don't know what
            > that is but, from the name alone, it seems quite possible that its
            > operation depends on being able to find another program in the path
            > such as rdate or ntpdate or ntpd or similar.
            >
            > If things are set up right, any output from the cron job
            > should be mailed to you. Do you get any error messages from the
            > cron job?
            >
            > John

            Hi John.

            Setting PATTH makes no differrence so far. I'm even testing with more
            simple crontabs and "most of the times" they don't work. Ex:

            SHELL=/bin/sh
            PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin

            0 0 * * * echo "hello!" >> /home/hello.txt

            At 00:00 sometimes hello.txt is created and edited and sometimes not.
            I'm plying with the system time in order to do my tests and this is
            maybe somehow causing problems, but I'm not sure.

            Now I realize that pointing to a script placed in /home or /etc
            doesn't make any difference either.

            ... I'm continuing with my tests...

            Thank you very much,

            Daniel.
          Your message has been successfully submitted and would be delivered to recipients shortly.