Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
okay this sounds really easy but I am having serious problems finding an anwser to this.
I want to sync *.htm and *.html between SOURCE AND DESTINATION. *.htm and
*.html which are not present in DESTINATION to be copied and *.htm and
*.html which are not present in SOURCE to be deleted in DESTINATION. I dont want rsync to touch any folders or their content.
Thanks, but this is not helping at all. If I remove --exclude='*' then ALL files AND folders are synced (files with suffix != html oder htm) and still the test.htm from DESTINATION which is not in SOURCE is not deleted.
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.
In your first case only --delete is being used.
In the second case (working) --delete-excluded is the one now being used hence its combination with --exclude='*' is providing you the functionality that you want, thus deleting all other files on the DST.
Note that --delete acts on the SRC side and --delete-excluded acts on the DST side
Last edited by chitambira; 03-04-2009 at 12:03 PM..
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.
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.
then folder files on destination is deleted (which I dont want)
Remember!!! --delete will delete files that donīt exist on the sending side, so when ever you specify it, be sure to delete some files on the /DST/ if they are not there in /SRC/
files folder on destination is not deleted but y.html on reciever is not deleted either.
In this case you are conflicting --delete and --exclude, and of course --exclude="*" wins, so --delete is not being used. y.html is not deleted because there nothing telling rsync to delete it.
You might want to take a look at unison. I'm not sure if it can do exactly what you want ('cause I'm still not clear myself on exactly what you want), but think it has a better chance than rsync.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.