Page 1 of 1

How to bash ftp?

Posted: Tue May 08, 2012 11:37 am
by crosenblum
I am working on a bash script that is going to upload a new version of xbmc4xbox to my original xbox.

my bash script downloads the latest zip file, unzip's it, grabs the old backup xml files and put's in the new download.

Then tries to ftp it to the host.

This original xbox is in my local network.

But it fails to upload folders.

Originally I tried wput but that failed too. Now I am trying regular ftp commands.

Code: Select all

ftp -n <<EOF
open $XBOX_IP
quote USER $XBOX_USER
quote PASS $XBOX_PASS
cd $XBMC_LOCATION
mput *
quit
EOF
Before i do this ftp command, i do a local cd to the folder that has the newest xbmc 4 xbox code/files.

Then from that folder I try to upload all the files and folders, but it somehow err's when uploading folders.

Once I get this bash script tight and error free, I will set it to run every week, to keep my xbmc on my original xbox fully up to date.

Any suggestions?

Re: How to bash ftp?

Posted: Mon Jun 25, 2012 3:04 pm
by Habitual
from what I gather from googling, mput * doesn't do recursion

Is there any reason it has to be ftp?
"ncftp and then call 'mput -r folder'." says http://serverfault.com/questions/91149/ ... ut-in-unix

subscribed with interest...