Where to start with Rsync command : 8 Rsync Examples

In this article, we are going to discuss some of the commonly used rsync examples that will familiarise you with rsync & help you get started with using rsync command.

Rsync command is used for transferring of files on Linux machines from one system to another. It uses method on incremental file transfer for copying the files & since the file transfer is incremental, only the difference among the two files is copied & not the complete file as is the case with other tools like scp. Rsync is very lightweight, it is fast as well as secure & also uses very low bandwidth for data copy.

Now before we move onto the rsync examples, let discuss it’s installation.

here in this example, we are only copying .txt files & excluding all other files.

7- Limiting the file size

With option ‘max-size’, we can also impose a limit on the size of the files that will be synced. Use the following example,

# rsync -arv –max-size=’100K’ /home/user /data/user

8- View the difference of files at source & destination

Rsync also provides option to check differences in the files at source & destination. This can be done using the option ‘i’,

# rsync -avzi /home/user /data/user

Now we should get output like,

>f.st…. Dan

.f….og. Susan

Here, the alphabets mentioned before the file name ‘Dan’ & ‘Susan’ tells what the difference in both files are,

f means that it is a file.

s means that there is size change.

t means change in timestamp.

o means change in ownership.

g means change of group.

Now these were only some commonly used rsync examples & there are many other rsync options that can be used but these will get you started. Please do let us know about any query or question you have regarding this tutorial using the comment box below.

If you have found this article to be useful, please share it among your friends/colleagues/followers. THANKS !!!

If you think we have helped you or just want to support us, please consider these :-