rsync --delete-hide

Anish Shankar rndanish at gmail.com
Sun Apr 6 03:57:24 MDT 2014


Hi,
I think a very similar functionality can be achieved by using the existing
--backup option? Using the backup (-b) option in conjunction with the --del
option allows you to set a suffix (using --suffix) . But of course you
can't add a prefix (to hide it) currently I think
So I might use something like:

rsync -rv -b --del --suffix=".deleted-$(date +%Y%m%d%H%M%S)" -f "P
*.deleted-[[:digit:]]*" src/ dst/

The -f filter rule would be required to protect existing deleted files from
getting deleted again.


On Sun, Apr 6, 2014 at 3:00 PM, Saku Vainikainen <saku.vainikainen at welho.com
> wrote:

>
> Hello!
>
> I was wondering wether or not this would be a viable option to add to
> rsync:
>
> --delete-hide
>
> Instead of deleting the file, rsync would rename the file using leading
> "." and trailing ".deleted-{timestamp}".
>
> rsync -rv --delete-hide /src/ /dst/
>
> For example if /src/readme.txt had already been rsynced to /dst/readme.txt
> and then later was deleted from /src, rsync would - instead of deleting
> /dst/readme.txt - rename /dst/readme.txt to
> /dst/.readme.txt.deleted-20140604120445.
>
> Rgrds,
> Saku Vainikainen.
>
> --
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20140406/4cdc07b0/attachment.html>


More information about the rsync mailing list