Ubuntu | Rsync

Author - Rita

Ubuntu provides a very useful command rsync that allows faster way to copy modified files from one location to another. It can work between 2 remote locations or even within local folders. First time rsync downloads all the files but when this command is executed next time, it will download only modified files.

To get modified files from a remote machine location to local follow these steps to configure rsync:

1. cd path_to_your_local_folder
2. Run below command to get remove server’s code on your local machine in current folder

rsync -avzh –exclude=folder_location remoteusername@remotehostname:sourceLocation       destinationLocation

It will ask for password. Type your password and it will download code from server to the local machine.

–exclude => This option is used to exclude some folders, such as logs, that can be very large in size and do not need to be synced.

a => Stands for “archive” and syncs recursively and preserves symbolic links, special device files, modification times, group, owner, and permissions.

v => verbose. It will show process execution progress in console.

z => compress. It will compress files before transferring.

h => human readable. it will show output in human readable format.

sourceLocation => location on the remote machine from where you want to get files

destinationLocation => location on your local machine where you want to put files. This can be dot (.) for current directory.

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Apps (Moodle/Totara), Websites and Mobile apps. If you need any software development assistance please contact us at dev@webners.com

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *