LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-04-2013, 12:45 PM   #1
ronn63
LQ Newbie
 
Registered: Nov 2013
Posts: 11

Rep: Reputation: Disabled
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!!
 
Old 11-04-2013, 08:39 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
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.
 
Old 11-04-2013, 09:09 PM   #3
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,
Quote:
Originally Posted by lleb View Post
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.
 
Old 11-04-2013, 09:43 PM   #4
ronn63
LQ Newbie
 
Registered: Nov 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
It appears that rsync won't run ftp. I'm using wget instead. Thanks anyways guys.
 
Old 11-04-2013, 09:54 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,
Quote:
Originally Posted by ronn63 View Post
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.
 
Old 11-05-2013, 11:27 AM   #6
ronn63
LQ Newbie
 
Registered: Nov 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
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!!
 
Old 11-05-2013, 03:34 PM   #7
ronn63
LQ Newbie
 
Registered: Nov 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
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.
 
Old 11-05-2013, 03:59 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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.
 
Old 11-05-2013, 04:16 PM   #9
ronn63
LQ Newbie
 
Registered: Nov 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-05-2013, 08:19 PM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,
Quote:
Originally Posted by ronn63 View Post
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.
 
Old 11-05-2013, 08:23 PM   #11
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,

Quote:
Originally Posted by ronn63 View Post
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.
 
Old 11-06-2013, 07:44 AM   #12
ronn63
LQ Newbie
 
Registered: Nov 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by evo2 View Post
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.
 
Old 11-06-2013, 07:47 PM   #13
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,
Quote:
Originally Posted by ronn63 View Post
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.
 
Old 11-11-2013, 12:40 PM   #14
ronn63
LQ Newbie
 
Registered: Nov 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
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?

Last edited by ronn63; 11-11-2013 at 12:42 PM.
 
Old 11-11-2013, 04:18 PM   #15
YankeePride13
Member
 
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262

Rep: Reputation: 55
You should put the username/password credentials in ~/.netrc

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync solaris + ld.so.1: rsync: fatal: libiconv.so.2: open failed: xxx_anuj_xxx Solaris / OpenSolaris 25 02-23-2012 04:23 AM
[SOLVED] rsync execution issue with crontab - Have given full path to rsync too!! Prabagaran Linux - Server 6 04-15-2011 02:39 AM
[SOLVED] rsync fails in cron - ssh key prob for rsync? jonathansfl Linux - Server 6 12-09-2010 10:48 AM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 05:08 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 03:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration