Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
11-04-2013, 12:45 PM
|
#1
|
LQ Newbie
Registered: Nov 2013
Posts: 11
Rep:
|
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!!
|
|
|
11-04-2013, 08:39 PM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983
|
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.
|
|
|
11-04-2013, 09:09 PM
|
#3
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Hi,
Quote:
Originally Posted by lleb
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.
|
|
|
11-04-2013, 09:43 PM
|
#4
|
LQ Newbie
Registered: Nov 2013
Posts: 11
Original Poster
Rep:
|
It appears that rsync won't run ftp. I'm using wget instead. Thanks anyways guys.
|
|
|
11-04-2013, 09:54 PM
|
#5
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Hi,
Quote:
Originally Posted by ronn63
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.
|
|
|
11-05-2013, 11:27 AM
|
#6
|
LQ Newbie
Registered: Nov 2013
Posts: 11
Original Poster
Rep:
|
Quote:
Originally Posted by evo2
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!!
|
|
|
11-05-2013, 03:34 PM
|
#7
|
LQ Newbie
Registered: Nov 2013
Posts: 11
Original Poster
Rep:
|
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.
|
|
|
11-05-2013, 03:59 PM
|
#8
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
You need two "-"'s before the "only-newer" flag.
rather than
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.
|
|
|
11-05-2013, 04:16 PM
|
#9
|
LQ Newbie
Registered: Nov 2013
Posts: 11
Original Poster
Rep:
|
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
|
|
|
11-05-2013, 08:19 PM
|
#10
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Hi,
Quote:
Originally Posted by ronn63
Is there a quick and easy guide on installing this package out there?
|
As always, use your package manager. What distro are you using?
That doesn't bode well. Please try using your package manager instead.
Evo2.
|
|
|
11-05-2013, 08:23 PM
|
#11
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Hi,
Quote:
Originally Posted by ronn63
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.
|
|
|
11-06-2013, 07:44 AM
|
#12
|
LQ Newbie
Registered: Nov 2013
Posts: 11
Original Poster
Rep:
|
Quote:
Originally Posted by evo2
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.
|
|
|
11-06-2013, 07:47 PM
|
#13
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Hi,
Quote:
Originally Posted by ronn63
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.
|
|
|
11-11-2013, 12:40 PM
|
#14
|
LQ Newbie
Registered: Nov 2013
Posts: 11
Original Poster
Rep:
|
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.
|
|
|
11-11-2013, 04:18 PM
|
#15
|
Member
Registered: Aug 2012
Distribution: Ubuntu 10.04, CentOS 6.3, Windows 7
Posts: 262
Rep:
|
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 11:53 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|