LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   rsync (https://www.linuxquestions.org/questions/linux-networking-3/rsync-4175483358/)

ronn63 11-04-2013 11:45 AM

rsync
 
Hello all!! I'm a relative Linux newbie. I've worked with HP-UX in the past though...

Here's my question: Want to rsync from a directory on an ftp server far away. Planning to setup as a cron job to run once a night, then email new transfers notification to me. Any ideas how to move forward?

Thank you in advance!!

lleb 11-04-2013 07:39 PM

first things first, verify that the ftp server is running Linux, if it is not you will not be able to use rsync. also that ftp server will have to allow for rsa passwordless keys. see the links in my sig to learn about setting up ssh keys.

also a simple bash script will work.

also if the ftp server allows for lftp connection you can use that instead of rsync.

evo2 11-04-2013 08:09 PM

Hi,
Quote:

Originally Posted by lleb (Post 5058423)
first things first, verify that the ftp server is running Linux, if it is not you will not be able to use rsync.

Actually it is probably only necessary to check that the machine is running sshd and has rsync installed. It doesn't have to be running linux.

Quote:

also that ftp server will have to allow for rsa passwordless keys.
The sshd needs to be configured to allow public key authentication, but it has no way of knowing if the key is protected by a passphrase or password.

Cheers,

Evo2.

ronn63 11-04-2013 08:43 PM

It appears that rsync won't run ftp. I'm using wget instead. Thanks anyways guys.

evo2 11-04-2013 08:54 PM

Hi,
Quote:

Originally Posted by ronn63 (Post 5058453)
It appears that rsync won't run ftp. I'm using wget instead.

From my first reading of your original post I thought that you wanted to use rsync to copy files to the machine running an ftp server. However from the above and from rereading post #1 I see this is not the case. Instead of using wget, have a look at using lftp with the --only-newer flag.

HTH,

Evo2.

ronn63 11-05-2013 10:27 AM

Quote:

Originally Posted by evo2 (Post 5058464)
Hi,

From my first reading of your original post I thought that you wanted to use rsync to copy files to the machine running an ftp server. However from the above and from rereading post #1 I see this is not the case. Instead of using wget, have a look at using lftp with the --only-newer flag.

HTH,

Evo2.

Thank you for your responses. I've decided to use lftp. Is there a quick and easy guide on installing this package out there? I've downloaded4.4.5.

Thanks!!

ronn63 11-05-2013 02:34 PM

Ok...I figured it out. Well, as far as downloading and installing goes. I've spent far too much time trying to no avail. Here's the command I've come up with so far:

lftp -u username,password -e mirror -only-newer ftp://ftp.server.far.away /server/nearby/home/me

I get an 'invalid option --'o', or 'unknown command 'sslica-file''

That's all the info I gots for the moment. I patiently await your reply.

suicidaleggroll 11-05-2013 02:59 PM

You need two "-"'s before the "only-newer" flag.

Code:

--only-newer
rather than
Code:

-only-newer
It's a convention in Linux that single "-"'s are used for single character flags, while double "-"'s are used when specifying the verbose name of the flag.

ronn63 11-05-2013 03:16 PM

Ok...I ran the command again. It casme back with

Unknown command 'ssl:ca-file'. and
lftp: unrecognized option '--only-newer'

I ran a ps -ef | grep lftp and it's running the command without the --only-newer option.

bizarre

evo2 11-05-2013 07:19 PM

Hi,
Quote:

Originally Posted by ronn63 (Post 5058771)
Is there a quick and easy guide on installing this package out there?

As always, use your package manager. What distro are you using?

Quote:

I've downloaded4.4.5.
That doesn't bode well. Please try using your package manager instead.

Evo2.

evo2 11-05-2013 07:23 PM

Hi,

Quote:

Originally Posted by ronn63 (Post 5058903)
Ok...I ran the command again. It casme back with

Unknown command 'ssl:ca-file'. and
lftp: unrecognized option '--only-newer'

How did you install lftp?

Evo2.

ronn63 11-06-2013 06:44 AM

Quote:

Originally Posted by evo2 (Post 5059008)
Hi,


How did you install lftp?

Evo2.

I used the zypper command to install it after I ran the ./configure. I'm assuming now that I did not use the correct procedure.

evo2 11-06-2013 06:47 PM

Hi,
Quote:

Originally Posted by ronn63 (Post 5059312)
I used the zypper command to install it after I ran the ./configure. I'm assuming now that I did not use the correct procedure.

OK good, AFAIK zypper is the package manger for opensuse and it will install binary packages.
Eg
Code:

zypper install tftp
After doing that, tftp should be installed and nothing else should need to be done.

Normally I would expect that ./configure would be run to prior to building a package from source. Can you please clarify what you actually did, and what distro you are running?

Evo2.

ronn63 11-11-2013 11:40 AM

Ok...I have everything installed and working I guess. The one issue I have now is getting the files from the ftp site and putting them into a certain local directory. I'm using the -O option. Here's the command I'm running:

lftp -u username,password -e mirror ftp://ftp.faraway.com/source/directory -O /home/local/directory

It comes back with lftp: invalid option -- 'O'

If I remove the -O option, it puts the file in whichever directory I'm in when the command is executed.

I also haven't had much success with the --only-newer command option.

Help please?

YankeePride13 11-11-2013 03:18 PM

You should put the username/password credentials in ~/.netrc

http://linux.die.net/man/5/netrc


All times are GMT -5. The time now is 02:16 AM.