in reply to FTP script suddenly not working from crontab

I dunno if this will help, but I once spent more than a full day trying to fix a small daily Oracle extraction that worked perfectly fine from the shell prompt but produced all kinds of errors when run from the cron tab. The problem had to do with a number of environment variables needed by Oracle that were not set the same way for regular users and for the cron tab user (I guess it was root, not sure to remember correctly though). You might have run into a similar problem: different environment variables.
  • Comment on Re: FTP script suddenly not working from crontab

Replies are listed 'Best First'.
Re^2: FTP script suddenly not working from crontab
by joetesta (Novice) on Jul 17, 2014 at 22:57 UTC

    I'm sure you've got to be right. It's so strange that it works sometimes. Now I've added to my crontab line a call to the user's .profile and it seems to be working!

    Old user's crontab line:

    * * * * * perl /home/user/data/code/copy.pl ftp3 >> /tmp/ftp3.log 2>&1

    New user's crontab line:

    * * * * * . ~/.profile; perl /home/user/data/code/copy.pl ftp3 >> /tmp +/ftp3.log 2>&1

    Well that lasted about a minute, timed out and back to errors from crontab