sorry for the late reply but I was on holiday. Still I dont seem to understand rsync.
Quote:
|
I meant to say, if you use --delete, then you DO NOT have to use --exclude='*', BUT if you use --exclude='*', and --delete-excluded, then you DO NOT have to use --delete to achieve what you want.
|
I need to use --exclude='*' even when not applying --delete-excluded because if I not use --exclude='*' then rsync deletes stuff on the reciever which I do not want to have deleted.
Sender:
folder: source\
a.htm
b.htm
c.htm
d.htm
Reciever:
folder: destination\
files\folderA\abc.pdf
files\folderA\abcd.pdf
files\folderA\abce.pdf
a.htm
b.htm
c.htm
y.html
Now if I do:
/usr/bin/rsync -ndolptgvze "/usr/bin/ssh -i /var/lib/wwwrun/.ssh/id_dsa" --delete --include='*.htm' --include='*.html' /source/ /destination/
then folder files on destination is deleted (which I dont want)
If I use:
/usr/bin/rsync -ndolptgvze "/usr/bin/ssh -i /var/lib/wwwrun/.ssh/id_dsa" --delete --include='*.htm' --include='*.html' --exclude='*' /source/ /destination/
files folder on destination is not deleted but y.html on reciever is not deleted either.
The solution I found erlier is only working if the reciver path is on the same host so I am back to 0 here. The problem still remains. How do I sync *.htm and *.html files in a folder w/o rsync touching anything else in that folder.