I want to move some files from one server to another . I want the public_html directory from server 1 to be transferred to server 2 . Can anyone give me the syntax to do so ? rsync keeps crashing my server after some hours . I'm using centos 7 .
Asked
Active
Viewed 1.5k times
-4
-
You should edit your question to provide more detail such as the rsync command you used and the output of that command. – Anthony Geoghegan Dec 20 '15 at 12:38
-
Hi using rsync my server crashes . I don't know why but I will investigate this crash issue and let you know if I find something . for know I will check to see if scp works – movi ran Dec 20 '15 at 14:43
2 Answers
1
scp -r <source path> <user_name>@<ip of server_2>:/<destination path>
Ex-
scp -r ./public_html movi@10.1.1.1:/home/movi

Lakal Malimage
- 486
- 1
- 4
- 10
-
Will this scp transfer remove the source files ? I don't want the source files to be deleted after transfer is complete . – movi ran Dec 20 '15 at 14:42
-
-
1[`man scp`](http://linux.die.net/man/1/scp) : No; `scp` **copies** files and may overwrite target files but does nothing to the sources... – HBruijn Dec 20 '15 at 15:37
0
You should use SCP when you want to do a one copy. And Rsync if you want to continues sync directories or files.
I'm using the following syntax for syncing over SSH
rsync -ah --delete -e ssh /path/to/source-folder user@server:/path/to/destination-folder
Don't worry about the --delete flag. That options only deletes files and folders in the destination folder when it doesn't exists in the source folder
I'm having a hard time thinking that this should cause your servers to crash. Please provide us with your rsync command so that we could look into this issue.
Br Sanderp

sanderp
- 74
- 2