How to bash ftp?

Forum rules
Before you post please read this

How to bash ftp?

Postby crosenblum on 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?
crosenblum
Level 1
Level 1
 
Posts: 40
Joined: Fri Apr 06, 2012 10:53 am

Linux Mint is funded by ads and donations.
 

Re: How to bash ftp?

Postby Habitual on 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...
What's a landing but a take off in reverse?
My DorkBlog
shellshock.conf for fail2ban 0.8.10
User avatar
Habitual
Level 8
Level 8
 
Posts: 2182
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest