Can rsync server mark deleted source files as extraneous?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can rsync server mark deleted source files as extraneous?

Samba - rsync mailing list
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

--
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 | Threaded
Open this post in threaded view
|

Re: Can rsync server mark deleted source files as extraneous?

Samba - rsync mailing list
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. [hidden email]  (work)
        Orlando, Florida [hidden email] (personal)
        Web page: http://www.sanitarium.net/
        PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,


--
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 (231 bytes) Download Attachment