[Discuss] Cron fail lesson of the day

Bill Bogstad bogstad at pobox.com
Sun Sep 15 19:44:22 EDT 2019


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


More information about the Discuss mailing list