How to bash ftp?

Forum rules
Before you post please read how to get help
crosenblum
Level 1
Level 1
Posts: 39
Joined: Fri Apr 06, 2012 10:53 am

How to bash ftp?

Postby crosenblum » Tue May 08, 2012 11:37 am

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?

User avatar
Habitual
Level 12
Level 12
Posts: 4207
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio

Re: How to bash ftp?

Postby Habitual » Mon Jun 25, 2012 3:04 pm

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...
Windows assumes you're an idiot.
Linux demands proof of it.


Return to “Scripts & Bash”

Who is online

Users browsing this forum: No registered users and 1 guest