BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] Cron fail lesson of the day



On Sun, Sep 15, 2019 at 12:49 PM David Kramer <david at thekramers.net> wrote:
>
> TFW your script works perfectly from the command line every damn time
> but fails when called from cron, even after you put the fill path for
> all commands.
>
> ... then you remember cron may not be running the same shell....

Your web site hosting account doesn't allow shell logins, but does allow
cron jobs (emails output back to you).   You enter a job to run 2 minutes in
the future and wait to be emailed the results.  No output received.  You try
just running the date command.  No output received.  You give up
and go to bed.   And find the output in your email the next morning.
You live in the Eastern timezone and the server lives in the Pacific
timezone.  Instead of 2 minutes in the future, you were requesting 3 hours
and 2 minutes.  It's been too long since I did remote system administration...

Bill Bogstad