Good Evening,
I am struggling with an automated script to upload a file to an FTP server.
Code:
#!/bin/sh
HOST="webcam.wunderground.com"
USER="XXXXXCAM2"
PASSWD="XXXXXXX"
FILE="/mnt/DoomNet/WeatherCAM1.jpg"
if [ -r $FILE ] && echo "File Exists" || echo "File does not exist"
then
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
fi
exit 0
Right now, I get the "File Exists" response, but immediately following this I get
"Can't open that file: No such file or directory". Can anybody help me here as I am banging my head against a wall. I am quite new to Linux so I am hoping this is something fundamental I am missing.
Thanks everybody
Gyro