* ENV vs BASH_ENV
@ 2008-07-21 15:58 Luca Ferrari
2008-07-21 16:16 ` Axl Purushu
0 siblings, 1 reply; 3+ messages in thread
From: Luca Ferrari @ 2008-07-21 15:58 UTC (permalink / raw)
To: linux-admin
Hi all,
I cannot find out the difference between defining the two variables, but I
discovered after a lot that having both set up in my crontab avoids a script
to run correctly. For instance if I have in my crontab:
ENV=/home/luca/.profile
BASH_ENV=/home/luca/.profile
then a shell script seems not to execute unless its output is redirect to a
file. So the line
00 10 * * * myBackup.sh
does not seem to run (or starts and ends immediatly), while
00 10 * * * myBackup.sh > /tmp/backup.log
works fine. If I run the backup script manually it works (it uses rsync).
What's the magic around the above variables?
Thanks,
Luca
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ENV vs BASH_ENV
2008-07-21 15:58 ENV vs BASH_ENV Luca Ferrari
@ 2008-07-21 16:16 ` Axl Purushu
2008-07-22 12:14 ` Luca Ferrari
0 siblings, 1 reply; 3+ messages in thread
From: Axl Purushu @ 2008-07-21 16:16 UTC (permalink / raw)
To: Luca Ferrari; +Cc: linux-admin
I think that the path of the script may be an issue. When you setup
scripts in crontab its best to use absolute paths for all commands or
scripts.
-Anup
On Mon, 2008-07-21 at 17:58 +0200, Luca Ferrari wrote:
> Hi all,
> I cannot find out the difference between defining the two variables, but I
> discovered after a lot that having both set up in my crontab avoids a script
> to run correctly. For instance if I have in my crontab:
>
> ENV=/home/luca/.profile
> BASH_ENV=/home/luca/.profile
>
> then a shell script seems not to execute unless its output is redirect to a
> file. So the line
>
> 00 10 * * * myBackup.sh
>
> does not seem to run (or starts and ends immediatly), while
>
> 00 10 * * * myBackup.sh > /tmp/backup.log
>
> works fine. If I run the backup script manually it works (it uses rsync).
> What's the magic around the above variables?
>
> Thanks,
> Luca
> --
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ENV vs BASH_ENV
2008-07-21 16:16 ` Axl Purushu
@ 2008-07-22 12:14 ` Luca Ferrari
0 siblings, 0 replies; 3+ messages in thread
From: Luca Ferrari @ 2008-07-22 12:14 UTC (permalink / raw)
To: linux-admin
On Monday 21 July 2008 Axl Purushu's cat, walking on the keyboard, wrote:
> I think that the path of the script may be an issue. When you setup
> scripts in crontab its best to use absolute paths for all commands or
> scripts.
>
Uhm...I don't believe this is the case, since the script is executed always
with a relative path, since I've set the PATH variable in the top of the cron
script.
Luca
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-22 12:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-21 15:58 ENV vs BASH_ENV Luca Ferrari
2008-07-21 16:16 ` Axl Purushu
2008-07-22 12:14 ` Luca Ferrari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).