arimbun

  • Author: arimbun
  • Published: Jul 16th, 2010
  • Category: Linux
  • Comments: 2

Introduction to rsync — quick file synchronisation

Tags: , ,

rsync is a very good utility for synchronising files over a network. It works based on the delta-transfer algorithm—only data in the source that do not exist on the destination are copied over. This method saves plenty of time and bandwidth compared to the standard cp command.

Example: rsync $SRC $DST

On your local machine, you can use this to:
1. Copy files in a directory into another. Below code will match all files in the home directory that have the .txt extension and copy them all into /path/to/heaven.

rsync -v /home/login_name/*.txt /path/to/heaven

2. Copy directories (recursively) from a directory into another. The command below is similar to the previous, except that all directories (and their contents) are copied as well.

rsync -vr /home/login_name/* /path/to/heaven

© 2010 arimbun

Powered by Wordpress and Magatheme