There are two different ways to handle this...

#1 rsync --link-dest.  Each rsync is to a new empty timestamped dir.
Files that have not changed are hard linked from the previous run.  The
result is many timestamps complete trees that can be restored as was at
the time of the run.

#2 rsync --backup-dir.  Each file that would be replaced or deleted is
instead moved into the backup directory.  The backup directory can be
time stamped to make pruning easier.

On 07/25/2017 12:56 PM, Wolfram Volpi via rsync wrote:
> rsync --delete option tells rsync to delete extraneous files from the
> receiving side (ones that aren't on the sending side).
> But if a user accidentally deletes a file, there is no way to restore it
> from the server.
> If --delete option is not used, and the local hard disk is destroyed,
> restored data will include old deleted files.
> 
> Is there a way for rsync server to retain backup of deleted source
> files, and mark them as extraneous?
> That way a directory can be restored from backup, excluding the old
> deleted files.
> 
> It could work something like this:
> 
>     when rsync server notices an unmarked extraneous file, it timestamps
> and marks the file as extraneous.
>     rsync server periodically deletes extraneous files like this
>         if (extraneous_mark == true and timestamp > current_date - age),
> then delete the file
>     where age is number of days extraneous files are retained.
>     
>     rsync client can restore deleted files from server.
>     rsync client can restore directory from server, excluding extraneous
> files.
>  
> 
> Thank you,
> Wolfram Volpi
> 
> 

-- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
        Kevin Korb                      Phone:    (407) 252-6853
        Systems Administrator           Internet:
        FutureQuest, Inc.               ke...@futurequest.net  (work)
        Orlando, Florida                k...@sanitarium.net (personal)
        Web page:                       http://www.sanitarium.net/
        PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
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

Reply via email to