简体   繁体   中英

How to the history of files changed on a Rsync server

How can I instruct RSYNC server to keep a copy of the old versions of the files that were updated?

Background info:

I have a simple RSYNC server running on Linux which I am using as a backup of a large file system (many TB). Let's call it the backup server.

On the source server, we run daily: $ rsync -avzc /local/folder user@backup_server::remote_folder

In theory, no files should be changed on the source server, we should only receive new files. But, nonetheless, it might be possible that some updates are legit (very very seldom). If rsync detects the change, it overwrites the old version of file on the backup server with the new one. Now, here is the problem: if the change was a mistake, I lose the data and do not have the ability to recover it.

Ideally, I'd like that rsync server keeps a backup of the replaced files. Is there a way to configure that?

My backups are local to the same machine (but different drive on a mount point of /backup/)

I use --backup-dir=/backup/backups-`date +%F`/ but then it starts nesting the things rather than having a load of backups-yyyy-mm-dd/ in the /backup/ folder.

如果有人遇到类似的问题,则有一个简单的解决方案:执行一个简单的cron来更改目标计算机中的访问权限。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM