Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying a LOT of file, from server to server? 1

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi,

I'm trying to move a site over from one server to another. The site is over 4.8Gb, and trying to do with a tar:

tar -cvvf backup.tar *

..and then using a SSH FTP session to copy over the files, didn't seem to work (I think the .tar got corrupt, as there was just too much in it)

I've used something before, where you just enter a command line - and it "copies" the files (CHMOD's being copied over too), onto a new server. Problem is, I can't remember the name of the command line tool I used :/

Anyone got any suggestions?

TIA

Andy
 
Try
Code:
ssh -r username@server1:[directory_to_copy] username@server2:/destination_directory
 
Hi,

Thanks - will that copy over sub-folders too?

TIA

Andy
 
Hi,

Gives:

consulto@consultoresdeinformatica.com [~]# ssh -r old_username@old.serverIP:/home/user/domain.com/public_html/ new_username@new.serverIP:/home/user/domain.com/public_html/
ssh: illegal option -- r
usage: ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-i identity_file] [-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-w tunnel:tunnel] [user@]hostname [command]
consulto@consultoresdeinformatica.com [~]#


I was thinking more like using rsync - but I can't get the formatting of the command right :(

rsync -avz linkssql@east.nmsrv.com:/home/linkssql/cool-clipart.com/* /home/mark/cool-clipart.com/

..can anyone see where I'm messing up?

TIA

Andy
 
Hi youradds ,

I believe obadare meant to use scp instead of ssh :

Code:
scp -r username@server1:[directory_to_copy] username@server2:/destination_directory



Good Luck
DrD
 
Hi,

Thanks, that did the trick :) Star coming your way ;)

Cheers

Andy
 
Your rsync command was nearly correct. This revised command should work:

rsync -avz linkssql@east.nmsrv.com:/home/linkssql/cool-clipart.com /home/mark/

There is no need for the *, rsync checks everything unless you exclude files. By removing the trailing slash on the cool-clipart.com, you are telling rsync to create that directory at the target location.

Alot of useful args that i use:

--delete <- removes files on the remote side that were deleted on the local side

--progress <- self explantory

--delete-excluded <- very useful. deletes files on the remote side that were copied before you put them in an exclusion list.

--exclude-from=/dir/filename.txt <-- create a list of filenames/folders to ignore. format is "- file,newline,- folder/" etc... note the - and the / at the end of a folder.
 
Thanks, will bookmark this post for when I need to do similar stuff in the future (I do a lot of server transfers ;))

Thanks for the feedback.

Cheers

Andy
 
Something GREAT about rsync is that you can keep a directory up to date without having to move everything across nightly. IE. 4.8tb the first weekend, then only the data that changed every night will keep the new box up to date until you make the cutover. This can greatly shortly the length of time a cutover needs!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top