We have a bash script that fires off nightly as part of a cron job. The script actually executes 4 scripts in sequence. The first script connects via FTPS to another server and downloads some files. The second script uses perl to manipulate the files. The third script then opens another FTP connection to a remote party and uploads the files there. The fourth script then moves those files to a local backup directory.
The problem I am encountering is that when executed as a cron job the first script does not download the relevant files. More accurately, it doesn't download ANY files. Since no new files are downloaded the following scripts do nothing. This worked as a cron job for the last several years (this process has been happening nightly for at least eight years). If I manually execute the script from the cron job the files download and are process and uploaded exactly as expected.
I modified the scripts called via the cron job to write all output to log files and when I manually execute the script from the cron job the logs populate as expected. When the scripts fires from cron only the first script writes any output and that just shows that no files were found. Since no new files are found the other scripts don't actually do anything and therefore no output.
I can post the scripts if needed though I would have to sanitize the data a bit (security reasons and such).
Any of you ever encountered behavior like this?
Edit: Could not be more detailed earlier because I was posting from my phone. Copy/paste from scripts referenced above:
This is running on an old sun server. And I mean old. Circa 2004 or so.
This is the script executed by the cron job.
#!/usr/local/bin/bash /home/aicxfer.bellsouth.com/bin/FTPSSL-BST-down.sh >> /home/aicxfer.bellsouth.com/ftpdownlog /home/aicxfer.bellsouth.com/bin/cmp.pl >> /home/aicxfer.bellsouth.com/cmplog /usr/local/bin/lftp -f /home/aicxfer.bellsouth.com/bin/lftp-script >> /home/aicxfer.bellsouth.com/lftuplog /bin/mv -f /home/aicxfer.bellsouth.com/data/NEW/* /home/aicxfer.bellsouth.com/data/OLD /bin/cp /home/aicxfer.bellsouth.com/data/OLD/*.CAB /home/docs/SEDB
I'll reply with more below so this post is not insane to view.
[link][11 comments]