Re: What is the different between cron executing and shell execution?
From: Alban Browaeys (prahal_at_yahoo.com)
Date: 01/30/05
- Previous message: Clive Menzies: "Re: sata drives"
- In reply to: h.wulff: "What is the different between cron executing and shell execution?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Clive Menzies: "Re: sata drives"
- In reply to: h.wulff: "What is the different between cron executing and shell execution?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|