LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-09-2018, 02:18 PM   #1
XRPotato
LQ Newbie
 
Registered: May 2018
Posts: 3

Rep: Reputation: Disabled
Copying a folder to and from two remote Linux servers


Hi,
Firstly, I hope this post is within the correct section. I have had a look and assume it is closest to my issue.

Problem:
I am looking for a solution of moving files (all one folder) from Server A to Server B (remotely)

ServerA/home/FolderwithFiles (to be moved)
ServerB/home/FolderEmpty (to receive the files)

Which would the method of choice be, to transfer a folder of files between two remote servers?

Any help on this matter would be greatly appreciated.

Last edited by XRPotato; 05-09-2018 at 02:19 PM. Reason: Typos
 
Old 05-09-2018, 02:20 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Use rsync.
 
1 members found this post helpful.
Old 05-09-2018, 03:02 PM   #3
XRPotato
LQ Newbie
 
Registered: May 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Use rsync.
Hi Smallpond, thanks for the quick reply.
Would this be possible through a remote source and a remote destination?
Also any opinions on the use of an FXP client?

TIA
 
Old 05-09-2018, 03:18 PM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
If you use rsync, it has to be installed on both servers.

You want to log in into one server and copy from there to the other server. The command would be something like this:
Code:
serverA$ rsync -av /home/FolderwithFiles/ serverB:/home/FolderEmpty
The backslash behind the first folder is very relevant. Use option -avn to run a test run.

Do not:
Code:
localhost$ rsync serverA:/home/FolderwithFiles/ serverB:/home/FolderEmpty
rsync is the correct tool.

jlinkels

Last edited by jlinkels; 05-09-2018 at 03:20 PM.
 
1 members found this post helpful.
Old 05-21-2018, 12:03 AM   #5
XRPotato
LQ Newbie
 
Registered: May 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the replies.
 
Old 05-21-2018, 02:54 PM   #6
myersmk
LQ Newbie
 
Registered: Apr 2018
Location: San Diego
Distribution: Enterprise Linux (CentOS/RHEL)
Posts: 7

Rep: Reputation: Disabled
Move vs Copy

Your question asked how to "move" files from ServerA to ServerB, the rsync examples above will "copy" those files, leaving the source files on ServerA.

If your intent is to "move" the files to the remote server the good news is you can still use rsync with --remove-source-files along with the flags above as well.

rsync --remove-source-files -avzh ServerA:/path/to/dir/ ServerB:/remote/svr/path/
 
  


Reply



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
There was an error copying the file into smb:// PcName/Folder/Folder morbid_bean Linux - Networking 3 01-19-2017 04:44 AM
Copying home folder from command line without copying hidden directories and files rm_-rf_windows Linux - General 2 04-12-2016 08:24 AM
[SOLVED] Copying the files inside a folder, without copying the folder (hopefully easy) tibberous Linux - Software 3 12-23-2010 01:50 AM
Copying MySQL data folder from Windows to Linux anjanesh Linux - General 2 05-09-2006 06:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:53 AM.

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