ftp mput without confirmation in shell script

Hi,

I need to upload the output of my MapReduce to my web server using FTP. Here is how I uploaded all the files of output folder to ftp with a single script

 

NOW=$(date +"%Y-%m-%d")
HTML_OUTPUT_FOLDER=output/output_html/$NOW
mkdir $HTML_OUTPUT_FOLDER

HOST='myftpsite'
USER='myftpuser'
PASSWD='myftppassword'
REMOTE_FOLDER=public_html/nandu/$NOW


cd $HTML_OUTPUT_FOLDER
echo Current directory
pwd
echo Files would be uploaded to $REMOTE_FOLDER

ftp -i -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
mkdir $REMOTE_FOLDER
cd $REMOTE_FOLDER
mput *.*
quit
END_SCRIPT

exit 0
cd $HOME/feed

note – ftp -n will mput the files without prompting.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s