April 6th, 2009, 11:36 AM
Cron job to FTP errors
I'm trying to set up a cron job to run as root so I can ftp some mysql dump files to another server, but I keep getting errors from the beginning.
Here's what I'm running
user ftpuser ftppass
It errors on "cd backups" stating that the folder doesnt exist. Then when it tries to log into my ftp server, it says login failed. If I run the exact same commands in the same order, from a command line, it works perfectly fine. So I don't understand what the cron job is getting confused about. I have the sh file set to 777 and running as root.
April 7th, 2009, 02:25 PM
So no one has any idea whatsoever huh? Not a clue huh?
Last edited by millercepbs; April 8th, 2009 at 04:01 PM.
April 10th, 2009, 09:19 AM
Comeon guys. Someone has to be able to help me with this. It's got to be something simple that I'm missing.
April 10th, 2009, 05:17 PM
Well thanks for the complete lack of help folks. I managed to finally figure out what the deal was. It still seems completely retarted that something that works in the command line, has to be altered this much to work in a script. Here's the working version for anyone that this might help...cause I actually will respond.
/usr/bin/ftp -n $SERVER <<END_SCRIPT
user $USERNAME $PASSWORD