For clarification: 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 other files. -----Urspr?ngliche Nachricht----- Von: Ehlers, Kolja [mailto:ehlers@clinresearch.com] Gesendet: Mittwoch, 4. M?rz 2009 15:13 An: rsync@lists.samba.org Betreff: Sync files not folders non recursively Hi all, I am now trying to find a solution to my problem for quite some time. I hope you can help. What I am trying to do is to simply sync files with a special suffix to a destination folder. So I dont want to transfer recursively but I want to delete files from the destination which are not in the source anymore. Closest I have gotten is using this command: /usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in clude='*.html' --exclude='*' /SOURCE/ /DESTINATION/ BUT this deletes Files from folder /DESTINATION/A which are not present in the Source. I dont want this to happen. Also it syncs folders to DESTINATION but I only want to sync files not folders. /usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in clude='*.html' --exclude='*' /SOURCE/* /DESTINATION/ This command does not delete Files from folder /DESTINATION/A but in this care --delete is not working - files which are not in the source anymore are not deleted from destination. Thanks for helping regards Kolja Gesch?ftsf?hrung: Dr. Michael Fischer, Reinhard Eisebitt Amtsgericht K?ln HRB 32356 Steuer-Nr.: 217/5717/0536 Ust.Id.-Nr.: DE 204051920 -- This email transmission and any documents, files or previous email messages attached to it may contain information that is confidential or legally privileged. If you are not the intended recipient or a person responsible for delivering this transmission to the intended recipient, you are hereby notified that any disclosure, copying, printing, distribution or use of this transmission is strictly prohibited. If you have received this transmission in error, please immediately notify the sender by telephone or return email and delete the original transmission and its attachments without reading or saving in any manner.
>I am now trying to find a solution to my problem for quite some time. I hope >you can help. What I am trying to do is to simply sync files with a special >suffix to a destination folder. So I dont want to transfer recursively but I >want to delete files from the destination which are not in the source >anymore. > >Closest I have gotten is using this command: > >/usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in >clude='*.html' --exclude='*' /SOURCE/ /DESTINATION/ > >BUT this deletes Files from folder /DESTINATION/A which are not present in >the Source. I dont want this to happen. Also it syncs folders to DESTINATION >but I only want to sync files not folders. > >/usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in >clude='*.html' --exclude='*' /SOURCE/* /DESTINATION/ > >This command does not delete Files from folder /DESTINATION/A but in this >care --delete is not working - files which are not in the source anymore are >not deleted from destination.I think you should use /SOURCE /DESTINATION (no trailing slashes). bye Fabi
Hi all, I am now trying to find a solution to my problem for quite some time. I hope you can help. What I am trying to do is to simply sync files with a special suffix to a destination folder. So I dont want to transfer recursively but I want to delete files from the destination which are not in the source anymore. Closest I have gotten is using this command: /usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in clude='*.html' --exclude='*' /SOURCE/ /DESTINATION/ BUT this deletes Files from folder /DESTINATION/A which are not present in the Source. I dont want this to happen. Also it syncs folders to DESTINATION but I only want to sync files not folders. /usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in clude='*.html' --exclude='*' /SOURCE/* /DESTINATION/ This command does not delete Files from folder /DESTINATION/A but in this care --delete is not working - files which are not in the source anymore are not deleted from destination. Thanks for helping regards Kolja Gesch?ftsf?hrung: Dr. Michael Fischer, Reinhard Eisebitt Amtsgericht K?ln HRB 32356 Steuer-Nr.: 217/5717/0536 Ust.Id.-Nr.: DE 204051920 -- This email transmission and any documents, files or previous email messages attached to it may contain information that is confidential or legally privileged. If you are not the intended recipient or a person responsible for delivering this transmission to the intended recipient, you are hereby notified that any disclosure, copying, printing, distribution or use of this transmission is strictly prohibited. If you have received this transmission in error, please immediately notify the sender by telephone or return email and delete the original transmission and its attachments without reading or saving in any manner.
On Wed, 2009-03-04 at 15:13 +0100, Ehlers, Kolja wrote:> What I am trying to do is to simply sync files with a special > suffix to a destination folder. So I dont want to transfer recursively but I > want to delete files from the destination which are not in the source > anymore. > > Closest I have gotten is using this command: > > /usr/bin/rsync -dnolptgvze --delete --delete-excluded --include='*.htm' --in > clude='*.html' --exclude='*' /SOURCE/ /DESTINATION/ > > BUT this deletes Files from folder /DESTINATION/A which are not present in > the Source. I dont want this to happen.--delete-excluded is doing that. Remove that option.> Also it syncs folders to DESTINATION > but I only want to sync files not folders.That shouldn't be happening given your include/exclude rules. Please pass -i and post the itemize output so I can see what is happening. -- Matt