On 31 August 2017 at 04:32, James H. H. Lampert
wrote:
>
> I added a line to echo $SHELL to my debugging log file, and
> that was it: if I ran it from cron, $SHELL was /bin/sh; if I ran it from a
> command line, $SHELL was /bin/bash.
Be careful to correctly understand
On 8/31/17, 5:16 AM, Reco wrote:
$ bash -c 'cd foo; echo $?'
bash: line 0: cd: foo: No such file or directory
1
To this:
$ dash -c 'cd foo; echo $?'
dash: 1: cd: can't cd to foo
2
Aha! That's what it was! Thanks!
At any rate, changing the test script's utterly nonspecific shebang
(that, I
Hi.
On Thu, Aug 31, 2017 at 08:03:51AM -0400, Greg Wooledge wrote:
> On Thu, Aug 31, 2017 at 06:52:28AM +0100, Jonathan de Boyne Pollard wrote:
> > James H. H. Lampert:
> >
> > > Could it be that |cron| is running it an entirely different shell, that
> > > doesn't understand the |if|
On Thu, Aug 31, 2017 at 06:52:28AM +0100, Jonathan de Boyne Pollard wrote:
> James H. H. Lampert:
>
> > Could it be that |cron| is running it an entirely different shell, that
> > doesn't understand the |if| statement?
> >
> Despite what others have said, the answer to this question is no.
James H. H. Lampert:
Could it be that |cron| is running it an entirely different shell,
that doesn't understand the |if| statement?
Despite what others have said, the answer to this question is no.
Whilst you /are/ running two different shells, the problem is not the
|if| statement. Both
On Wed, Aug 30, 2017 at 09:32:37PM +0300, Reco wrote:
> > > #!
>
> A curious shebang.
> > Why would the behavior be any different? Could it be that cron is running it
> > an entirely different shell, that doesn't understand the "if" statement?
>
> Presumably your script runs via /bin/bash in
On Wed 30 Aug 2017 at 11:07:36 (-0700), James H. H. Lampert wrote:
> Can somebody explain this:
>
> My backup script WILL detect that ExternalHD is not mounted, and
> attempt to mount it, if I run it manually.
>
> But it WON'T do that if it runs in a cron job.
>
> I've isolated the relevant
A few minutes ago, with respect to my backup script attempting to mount
ExternalHD if run from a command line, but not from cron, I wrote:
Why would the behavior be any different? Could it be that cron is
running it an entirely different shell, that doesn't understand the "if"
statement?
That
Hi.
On Wed, Aug 30, 2017 at 11:07:36AM -0700, James H. H. Lampert wrote:
> Can somebody explain this:
>
> My backup script WILL detect that ExternalHD is not mounted, and attempt to
> mount it, if I run it manually.
>
> But it WON'T do that if it runs in a cron job.
>
> I've isolated
Can somebody explain this:
My backup script WILL detect that ExternalHD is not mounted, and attempt
to mount it, if I run it manually.
But it WON'T do that if it runs in a cron job.
I've isolated the relevant code into its own script, added debugging
output, and set it up to run every
10 matches
Mail list logo