How to bash ftp?

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

How to bash ftp?

Post by 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
mput *
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?

Level 13
Level 13
Posts: 4871
Joined: Sun Nov 21, 2010 8:31 pm

Re: How to bash ftp?

Post by 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 ... ut-in-unix

subscribed with interest...

Post Reply

Return to “Scripts & Bash”