Re: What is the different between cron executing and shell execution?

From: Alban Browaeys (prahal_at_yahoo.com)
Date: 01/30/05

  • Next message: Tomaz Kravcar: "Re: Kernel Upgrade?"
    To: debian-user@lists.debian.org
    Date: Sun, 30 Jan 2005 17:01:59 +0000 (UTC)
    
    

     <h.wulff> writes:

    > All variables are defined in the header of this script.
    > and LOG2SYSLOG looks like this:

    i don't know those. But cron have a few differences with a regular shell.

    It use "sh" to execute the scripts thus it s an interactive shell, but it don't
    have the environment comming from a console login (/etc/profile and the like)
    nor the one from a Xsession.
    PATH is the most often encountered problem in the cron context : check by
    replacing your program call by the full path to the executable :
    example:
    basename by /usr/bin/basename.

    Most scripts which are used in different contexes and different platform use:
    BASENAME=$(which basename).
    PS: Some do this to avoid crackers by checking that the full path is correct
    (/usr/bin/program or /bin/program), so i am not sure it is required for scripts
    to work in your cron .

    Cheers
    Alban

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Tomaz Kravcar: "Re: Kernel Upgrade?"

    Relevant Pages

    • cron messes up time format
      ... I've done this by using cron to run bash ... scripts which run python scripts which gather the data. ... since I think it's the difference between the bash shell I'm ...
      (comp.unix.bsd.freebsd.misc)
    • Re: [opensuse] Re: cron problems
      ... then job start logging is turned off. ... in message log when expected cron mail does a disappearing act. ... Which SUSE version is this? ... if the majority of the standard SuSE scripts explicitly log their status. ...
      (SuSE)
    • Re: What exactly does cron task weekly do?
      ... cron task weekly does. ... You don't have to run the scripts manually. ... I have never had my user crontab file modified in any way when prforming ... It is what anacron is for. ...
      (comp.sys.mac.system)
    • [NEWS] MacOS X TruBlueEnvironment Privilege Escalation Attack
      ... TruBlueEnvironment is part of the MacOS Classic Emulator. ... By setting certain environment variables, ... run automatically via cron. ... remove global execute permissions from the TruBlueEnvironment executable, ...
      (Securiteam)
    • Re: cron messes up time format
      ... I've done this by using cron to run bash ... scripts which run python scripts which gather the data. ...   # `erase' character from control-H to DEL. ...
      (comp.unix.bsd.freebsd.misc)