prevent filter excluded files from being deleted

Heiko Schlittermann via rsync <[email protected]>
Newsgroups gmane.network.rsync.general
Organization schlittermann -- internet & unix support
Message-ID <[email protected]>
Hello,

given are 2 directories:

    a
    ├── a-file
    └── .rsync-filter

    b
    └── a-file

I'd like to sync a/ -> b/, but I'd like to *exclude* all files. But I do
not want to delete the excluded files. (The real scenario is a way more
complex, the above is my reproducer.) 

and the following rsync command: `rsync -F --del a/ b/`
Note, there is *no* `--delete-excluded`:

    $ rsync -F --del -inav a/ b/
    sending incremental file list
    *deleting   a-file
    .d..t...... ./

    sent 62 bytes  received 29 bytes  182.00 bytes/sec
    total size is 0  speedup is 0.00 (DRY RUN)

Why? Because it is excluded? Using the `--exclude` option does what I
expect:

    $ rsync --exclude 'a-file' --del -inav a/ b/
    sending incremental file list
    .d..t...... ./
    >f+++++++++ .rsync-filter

    sent 92 bytes  received 22 bytes  228.00 bytes/sec
    total size is 4  speedup is 0.04 (DRY RUN)

even does what I expect:

    $ rsync --filter '- *' --del -inav a/ b/
    sending incremental file list
    .d..t...... ./

    sent 58 bytes  received 19 bytes  154.00 bytes/sec
    total size is 0  speedup is 0.00 (DRY RUN)

Version:
rsync  version 3.2.3  protocol version 31

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
--
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEE0L/WueylaUpvFJ3Or0zGdqa2wUIFAmQGVXQACgkQr0zGdqa2
wUL++Qf/Riq+Ibw6YaFNo9Hzb4fYBNGz9gMWmFBsSqXj3FRWIs33v224VDc+zLEv
VpXjEnHbCIe1AIatRvuxYH961v889BbR8bReeQWFP/O6qZFRZr0Y0N1Jz1llBb+5
hLbXl7636/PFW7mp2zcfJuznUfDfnlUz/q4y/241PDaN8eiyTaF/Sf2ZV1Kc9Lpf
VhzpisI5kL4oyS3MW1TfriHEfjEZllJpVZX0z4GQ/t/wn8IeEph7xBnM84MIfkD+
MbbEB/C1vCrXjpAvq9G5PDpWSSMMgoXQakAL8rHH67ia2E04PQq6yRl2b4hat/oW
mLrHHv40XJNdv3XoRbed1KBr1Ebu7g==
=pv/R
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.