Copy Folders from one Unix server to another?

I would like to copy a folder from one Unix server to another Unix server. Can anyone tell me if there is a method or command to to achieve this?

4 Answers

Yes, there is scp or the former rcp or rsync

scp -r source_folder :destination_folder

The command above will copy source_folder to destination_folder in the user's home directory on host.com

3

If your folder contains subfolders and more importantly symlinks you want to use rsync:

rsync -aruv localfolder/ user@server:destination/

Or in reverse:

rsync -aruv user@server:destination/ localfolder/

This will do a recursive backup / copy from localfolder to your server while keeping ownership and permissions intact. The solutions suggested so far are valid however scp doesn't handle symlinks by default and will instead create a new copy of the linked file.

For detailed usage see man(1) rsync or here

0

You can use SCP:

scp -rp foldertocopy/ user@server:destination/

or

rsync

First login to the server to which you want to copy folder or file. Be in folder where u want to copy and execute command "wget "

for this folderuwanttocpy.zip in source server should be in /var/www/html if it is linux server (or) xamp/httdocs if it is windows server

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like