Rsync
From Waisman Brain Imaging Wiki
Overview
'rsync' is a second cousin of 'mv', 'cp' and FTP -- it is used for moving or copying data from one location to another. It has some very nifty features:
- Like FTP, it can be used to move data between computers that aren't sharing disks or login information. They just need to both be on the internet, and you need accounts on both.
- Like 'cp -R' or 'mv', it can be used to transfer entire directory trees, not just one file at a time.
- It can verify the transferred data, so you'll know that things go OK, and that there aren't any lost files or data corruption.
- It can synchronize similar data between two sites, much like a PDA does with it's host computer. Each site will have all of the files, and the latest version of each once the synchronization is done.
Example
Here's a simple example of using 'rsync' to copy one directory (and all of it's contents) to a new place:
rsync -carv originalDirectory/ copyDirectory/
Note that each directory name has a '/' on the end. This matters. 'rsync' will do things differently depending on if the trailing '/'s are there or not. For a simple copy, both directories should have them.
Here are what the flags mean:
- -c -- Checksum. Verify the data that's being copied.
- -a -- Archive mode. Try and make as exact a copy as possible (preserve links, permissions, creation/modification dates in addition to copying data)
- -r -- Recurse. Don't just do this directory, but everything underneath it as well.
- -v -- Be verbose. Tell me everything you're doing.
rsync Resources
- The rsync man page (http://samba.anu.edu.au/ftp/rsync/rsync.html)
- An rsync tutorial (http://everythinglinux.org/rsync/)
Back to UNIX

