LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   lftp between 2 remote hosts (https://www.linuxquestions.org/questions/linux-software-2/lftp-between-2-remote-hosts-4175577657/)

famadorian 04-17-2016 09:05 AM

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.

TB0ne 04-17-2016 09:25 AM

Quote:

Originally Posted by famadorian (Post 5532432)
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.

famadorian 04-25-2016 07:40 AM

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.

TB0ne 04-25-2016 09:00 AM

Quote:

Originally Posted by famadorian (Post 5536177)
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.

famadorian 04-25-2016 09:16 AM

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?

TB0ne 04-25-2016 08:30 PM

[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.


All times are GMT -5. The time now is 10:12 AM.