LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-17-2016, 10:05 AM   #1
famadorian
LQ Newbie
 
Registered: Apr 2016
Posts: 3

Rep: Reputation: Disabled
lftp between 2 remote hosts


I'm reading myself blind here

I want to mirror a directory between two remote SFTP hosts with lftp.

I'm on my local computer and I have two hosts, system0 and system1

So, something like lftp sftp://system0 sftp://system1, then mirror /directory between system0 and system1

Can someone give me some pointers or an example.

Thanks.
 
Old 04-17-2016, 10:25 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,342

Rep: Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040
Quote:
Originally Posted by famadorian View Post
I'm reading myself blind here
I want to mirror a directory between two remote SFTP hosts with lftp. I'm on my local computer and I have two hosts, system0 and system1 So, something like lftp sftp://system0 sftp://system1, then mirror /directory between system0 and system1

Can someone give me some pointers or an example.
The LFTP wiki has a section that explicitly has examples on mirroring....did you try that?
https://www.linux.com/news/cli-magic...sy-backup-lftp

Also, why use lftp AT ALL? Rsync is standard on most Linux systems, and does EXACTLY what you're after, including keeping two directories in sync, and it supports SSH. You don't tell us what version/distro of Linux you're using, or provide many details...see the "Question Guidelines" link in my posting signature.
 
Old 04-25-2016, 08:40 AM   #3
famadorian
LQ Newbie
 
Registered: Apr 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
That link you provided talks about synchronizing a remote directory with a local one. The original question was about sync between a remote directory and a remote directory.
 
Old 04-25-2016, 10:00 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,342

Rep: Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040
Quote:
Originally Posted by famadorian View Post
That link you provided talks about synchronizing a remote directory with a local one. The original question was about sync between a remote directory and a remote directory.
...and did you not think about:
  • Running it on system0, making THAT ONE the local and system1 the remote?
  • The fact that your local system can look at BOTH of them, and use the software to keep them in sync?
  • Try to change ANY of the parameters based on the guide, to do what you wanted??
And AGAIN, LFTP isn't the best solution. Rsync, as stated before, does all of this over SSH, and can be set up in a cron job on one of the systems to do exactly what you're after.
 
Old 04-25-2016, 10:16 AM   #5
famadorian
LQ Newbie
 
Registered: Apr 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Well, I know how to mirror using from one host to another, but I don't know how to mirror when I got two remote hosts. I don't want to log in to one of the hosts; that's why I created this thread.

Do you know how to do this with lftp or not?

I can also use rsync, but does rsync sync between two remote systems?
 
Old 04-25-2016, 09:30 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,342

Rep: Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040Reputation: 6040
[QUOTE=famadorian;5536232]Well, I know how to mirror using from one host to another, but I don't know how to mirror when I got two remote hosts. I don't want to log in to one of the hosts; that's why I created this thread.QUOTE]
Why? That is, by far, the easiest and most reliable solution.
Quote:
Do you know how to do this with lftp or not?
Yes..it was in the instructions you were sent. Read the documentation, and replace the targets however you want.
Quote:
I can also use rsync, but does rsync sync between two remote systems?
As said before, yes. Again, doing this from one remote server to another is far better, easier, and more reliable.
 
  


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
lftp mirror function, ruined user:group on remote, cant delete files MJkrakowski Linux - Software 0 12-12-2012 11:44 PM
lftp remote server du -sh + mail script sappi Programming 3 07-28-2012 09:03 PM
LVM over remote hosts neoelf Linux - Networking 2 07-16-2009 10:34 AM
rsync over two remote hosts Meson Linux - General 5 01-12-2008 09:46 AM
xinetd, remote X display, hosts.allow fgeter Linux - Security 0 01-12-2003 11:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration