File Synchronization With Rsync - Doing More (Page 6 of 9 )
It's possible to obtain a list of all the modules available on the rsync server by omitting the module name from the command line when connecting to the server. Here's an example, and the output:
[me@xanadu] $ rsync olympus::
home My Home Area
Now, if I were to add a few more modules to the configuration file,
[temp]
path = /tmp comment = Temp Arealist = yes
restart the rsync server on "olympus",
[me@olympus] $ killall rsync
[me@olympus] $ rsync --daemon
and attempt to reconnect to it from "xanadu", I'd have access to the new modules as well.
[me@xanadu] $ rsync olympus::
home My Home Areatemp Temp Area
You can exclude modules from being listed in this manner by specifying a
list = no
option within the module configuration.
It's also possible to tell rsync to exclude certain files from the synchronization process, with the "--exclude" command-line option. Here's an example, which copies all the files *except* those with a ".tmp" extension from "xanadu" to "olympus":
[me@xanadu] $ rsync --verbose --progress --stats --recursive
--exclude="*.tmp" olympus::home/ .
Finally, rsync's default behaviour when encountering symbolic links is to omit them - as in the following example:
[me@xanadu] $ rsync --progress --recursive olympus::home/ .
skipping non-regular file "public_html/config.lib.php3" skippingnon-regular file "public_html/start.php"
As you can see, when I attempt to copy the "/home/me/public_html" directory to "xanadu", every symbolic link within that directory is skipped. You can have rsync retain these links as is during the copy process by specifying the "--links" option on the command line,
[me@xanadu] $ rsync --progress --recursive --links olympus::home/ .
or replace the symbolic links by the actual files being referenced with the "--copy-links" option.
[me@xanadu] $ rsync --progress --recursive --copy-links olympus::home/
.
Next: What's In A Name? >>
More Administration Articles
More By icarus, (c) Melonfire