How to mirror only specified directories
iskinner at cdpr.ca.gov
Tue Sep 28 08:54:15 MDT 2010
I am trying to mirror only select directories from one server to another with rsync through its daemon mode.
I wish to copy everything in the /docs directories under the /das, /em and /psb directories (in this simplified example) moving them from /export/home on server A to /export/home/extranet on server B.
This is what I have in a rsyncd.conf on server B.
path = /export/home/extranet
comment = California Department of Pesticide Regulation Extranet
uid = webuser
gid = other
read only = no
list = yes
hosts allow = ww.xxx.yy.zz
secrets file = /etc/.password
auth users = aaa
Here is the command I've tried on server A
/usr/local/bin/rsync -n -vvv --stats -Pzrtpl --delete --password-file=/export/home/webuser/.appprod --log-file=/export/home/webuser/logs/rsync-log --include "/export/home/[internal|das|em|enf|itb|medtox|pml|psb|reg|whs]/htdocs/docs/*" --exclude "/*" /export/home/xterernal/htdocs/ webuser at appprod::dprweb_extranet
This is failing with this message in the output.
sending incremental file list
rsync: change_dir "/export/home/xterernal/htdocs" failed: No such file or directory (2)
Why was it looking at the "/export/home/xterernal/htdocs" directory. The external is one of the many directories I am trying to ignore.
Where is it trying to change to the /export/home/xterernal/htdocs directory? On server B? If so, that is not the desired path, /export/home/extranet/... is the desired destination.
Can anybody provide some guidance on how to filter to select directories and mirror them to another server with a different base path?
More information about the rsync