I will briefly explain what RSYNC is, its usability and areas of use at an entry level. I will continue providing more information about RSYNC with more advanced explanations in later articles.
RSYNC is an indispensable copying system especially in cluster machines. Rather than just copying, you can also use RSYNC as an update software. For example, let X and Y be two servers. We copy the /home directory from server X to server Y using RSYNC. A total of 10GB of data is copied. After 1 day, we copy files from server X to server Y again, and in the 2nd copy, we ensure that only files whose size, format, or date have changed during the 1-day period are copied. This time, only 400MB is transferred from server X to server Y. This gives us a huge bandwidth saving.
RSYNC can use transparent shells like rsh or ssh. It does not require root privileges and can transfer files to another location without changing ownership, group, or permissions (chmod values). By compressing data during file transfer, the transfer speed is much faster than normal transfer.
Example commands:
# Copy the osman directory to home2
rsync -av /home/osman /home2
Copy contents of osman directory into home2
rsync -av /home/osman/ /home2
Copy all jpg files to remote server
rsync /home/osman/public_html/images/*.jpg root@212.68.41.1:home/osman2/public_html/images/
Copy from remote server to local
rsync -avz root@212.68.41.1:home/osman2/backup /backup/osman
Copy with all attributes preserved
rsync -avz -l -p -t /osman/file /home/osman
Each time you run the last command, it will only copy changed files. This provides a great time saving and reduces traffic between servers on different networks.
Leave a Comment
* Your comment will be published after approval.
Comments
0No comments yet. Be the first to comment!