Wolfram Volpi
2017-Jul-25 16:56 UTC
Can rsync server mark deleted source files as extraneous?
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20170725/0995d936/attachment.html>
Kevin Korb
2017-Jul-25 17:38 UTC
Can rsync server mark deleted source files as extraneous?
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. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 224 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20170725/5319fbb7/signature.sig>