How to sync the data from one server to another server via ssh

    Posted in Linux Servers on Oct 12, 2018

    Sync the data from one server to another server using rsync on linux server.

    Rsync is one of common ways to copy files and folders between two servers, whether the servers are local or remote.

    Login to the server via ssh OR putty Gen windows application.

    ssh root@oldserverIP 
    
    rsync -ravP /home/user/file_name root@xx.xx.xx.xx:/home/user/d

    Here first refers the source path from where you are syncing the file

    and xx.xx.xx.xx refers destination server IP and the destination path where you would like to save the data.

    Please check the following usefull rsync variables :

    -v : Verbose
    
    -a : archive mode
    
    -r run command recursively in directory
    
    -P : progress