Hello I'm looking for a way to exclude and delete some items but not delete other items. Use case: I'm on Windows where there are folders like recycle.bin and system volume information on every drive. I can exclude them while backing up my data drive. But I now also have other data that is excluded and that I want to delete from my existing backup. However if I use --delete-excluded then rsync tries to delete the (write protected) system volume information from the destination disk. Is there a way to get around this with only rsync parameters? Do I have to move the destination into a directory to get rid of the interfering drive root folders in the sync process? Thanks bye Fabi
Hi, On 5/12/18 12:36 am, Fabian Cenedese via rsync wrote:> I'm looking for a way to exclude and delete some items but not delete > other items. Use case: > > I'm on Windows where there are folders like recycle.bin and system > volume information on every drive. I can exclude them while backing > up my data drive. But I now also have other data that is excluded > and that I want to delete from my existing backup. However if I use > --delete-excluded then rsync tries to delete the (write protected) > system volume information from the destination disk. > > Is there a way to get around this with only rsync parameters? > Do I have to move the destination into a directory to get rid of > the interfering drive root folders in the sync process?Perhaps use read only attributes on the items that you don't want to allow to be deleted? Also maybe user .rsync-filter ? Make sure you experiment with good backups, just in case it goes wrong somehow. Hope that helps. Cheers A. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20181205/a842cc51/signature.sig>
>> I'm looking for a way to exclude and delete some items but not delete >> other items. Use case: >> >> I'm on Windows where there are folders like recycle.bin and system >> volume information on every drive. I can exclude them while backing >> up my data drive. But I now also have other data that is excluded >> and that I want to delete from my existing backup. However if I use >> --delete-excluded then rsync tries to delete the (write protected) >> system volume information from the destination disk. >> >> Is there a way to get around this with only rsync parameters? >> Do I have to move the destination into a directory to get rid of >> the interfering drive root folders in the sync process? > >Perhaps use read only attributes on the items that you don't want to >allow to be deleted? > >Also maybe user .rsync-filter ?The destination system folders are already write protected, that's not the problem. But if rsync fails to delete those folders then it will also skip deleting other data that I'd like to get rid of. I don't think that filters will help me as they are just another way of writing --include and --exclude but not what will happen with the excluded items. Thanks bye Fabi
You need to switch to filters where you have the additional options hide, show, risk, and protect. See the filter rules section of man rsync. On 12/4/18 8:36 AM, Fabian Cenedese via rsync wrote:> Hello > > I'm looking for a way to exclude and delete some items but not delete > other items. Use case: > > I'm on Windows where there are folders like recycle.bin and system > volume information on every drive. I can exclude them while backing > up my data drive. But I now also have other data that is excluded > and that I want to delete from my existing backup. However if I use > --delete-excluded then rsync tries to delete the (write protected) > system volume information from the destination disk. > > Is there a way to get around this with only rsync parameters? > Do I have to move the destination into a directory to get rid of > the interfering drive root folders in the sync process? > > Thanks > > bye Fabi > >-- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: https://sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 195 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20181204/22315cfe/signature.sig>
>You need to switch to filters where you have the additional options >hide, show, risk, and protect. See the filter rules section of man rsync.Thanks for the hint. Though I've been using rsync for years this part has somehow escaped me. I've read up on the filters and they do what I need. The docs could use a few samples but I did get it to work. Thanks bye Fabi