How to bash ftp?

Forum rules
Before you post please read how to get help

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
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 1
Level 1
Posts: 39
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 ... ut-in-unix

subscribed with interest...
I will defend your right to make a choice.
But you must defend the choice you made.
User avatar
Level 10
Level 10
Posts: 3114
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio

Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 3 guests