Monday, August 28, 2017

Copy large number of files between Linux servers

You can use "rsync" command to sync data between two locations.

rsync -r dir1/ dir2
sync the contents of dir1 to dir2 on the same system (-r option for recursive)

rsync -a dir1 username@remote_host:destination_directory
sync directory from the local system to a remote system ( pushing files to destination)

rsync -a username@remote_host:/home/dir1 place_to_sync_on_local_machine
sync a remote directory to the local system (pulling files from remote machine)

Also, you can compressed and sync files between locations using following command.

rsync -az source destination

https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps

No comments:

Post a Comment