exclude hidden files from rsync
Hi,
I am using --exclude=".DAV" to exclude .DAV folders from rsync jobs. But .DAV folder is also copying in target path. This is my job when I do : ps -ef | grep rsync www 2188 1614 0 12:07 pts/4 00:00:00 /local/rsync --exclude=".DAV" --rsync-path=/local/rsync -vt --stats --progress --compress -e /usr/bin/ssh -x -p 22 --partial-dir=/local/partial --block-size=5000 --temp-dir=/local/inbound --timeout=3600 /local/myFiles/.DAV/ignore.zip www@www.dev.com:"/local/myFiles/.DAV/ignore.zip" Can you please tell me what I am wrong here? why .DAV hidden folder is not excluded. PS: my rsync command is created from java which will check for every 15 mins for new files. If it finds any new files, then creates a rsync job. Thanks |
Hi!
rsync's man page says: Code:
--exclude=PATTERN Hint: Code:
--exclude='*.old' HMW Edit: Wait a minute! Maybe I misunderstood, if you simply want to exclude a SINGLE DIRECTORY, you can give the pathname to --exclude, something like this: Code:
$ rsync -avz --exclude 'local/myFiles/.DAV' source/ destination/ |
It is difficult to exclude something that you specifically asked to be included. Your command line argument "/local/myFiles/.DAV/ignore.zip" happens to lie within the excluded ".DAV" directory, but rsync never actually processes that directory.
|
@HMW
Thanks for your reply. in my case, I am not excluding only one particular file. .DAV folder can be anywhere. I have to exclude all .DAV folders. @rknichols Yes You are correct. my Java already initiated rsync job for the file from .DAV folder. In this case rsync cannot do anything even I have used exclude command. Now I understood. I stopped creating rsync jobs in java if source path contains .DAV. now it is working. Thanks. |
All times are GMT -5. The time now is 11:43 AM. |