rsync --delete-hide

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

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
> 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:
> Before posting, read:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rsync mailing list