Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Rsync is a data transfer tool. To use rsync you will be provide it with a target, and a destination. For each file in the target, rsync will first look to see if the file exists in the target. If not, then rsync will transfer a copy of the file to the target. If file does exist on the target, then rsync confirms that the files are the same. If not, then it determines the smallest amount of data that needs to be transferred to make the target file look like the source file. This makes rsync ideal for mirroring sets of files. Because rsync ignores files that are up to date it's also useful for resuming a transfer that might have gotten interrupted. However, this powerful piece of software can easily be used to create a mess, so if you wish to use rsync you should carefully read through this document to make sure you understand its proper use.

UNIX users (and Mac by use of Terminal.app) can use rsync by typing

rsync -a other_opts src tgt

src could be either a file, or a directory. If it is a file, then the file is simply synced over to the target. If, src is a directory, then it is still synced over in the obvious way and tgt/src is created. Note that in this case, all of the files that are contained in src, or in its sub directories are copied over (ie, the entire file tree rooted at src is copied over). This makes sense if you think that it has synced src, and it just happens that this case. You can also use src/ in which the files, or directories inside of src (the contents) are synced over into target. Here are some examples,

source meaning

tgt can be another local directory, or it can be prefixed with a hostname to indicate that you wish to transfer the files to that system. If you just use a hostname, then it's assumed that you are specifying that the files should be synced in to your home directory. Here are some examples,

target meaning
b rsync to file or directory named b
b/ rsync specifically to a directory named b (ie, fail if it is not one)
/a/b/c rsync to a directory located by a full path name
host:a/b/c rsync to remote host, and store files in the path a/b/c relative to the user's home directory
host:/a/b/c rsync to remote host, and store files in the absolute path /a/b/c

CCBB UNIX users note: Please do not sync files

  • No labels