简体   繁体   English

如何在Rsync服务器上更改文件的历史记录

[英]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? 如何指示RSYNC服务器保留已更新文件的旧版本的副本?

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). 我有一个运行在Linux上的简单RSYNC服务器,它用作大型文件系统(许多TB)的备份。 Let's call it the backup server. 我们称它为备份服务器。

On the source server, we run daily: $ rsync -avzc /local/folder user@backup_server::remote_folder 在源服务器上,我们每天运行:$ 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. 如果rsync检测到更改,它将用新版本覆盖备份服务器上的旧版本文件。 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. 理想情况下,我希望rsync服务器保留替换文件的备份。 Is there a way to configure that? 有没有一种配置方法?

My backups are local to the same machine (but different drive on a mount point of /backup/) 我的备份在同一台机器上本地(但在/ 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. 我使用--backup-dir=/backup/backups-`date +%F`/但是它开始嵌套内容,而不是在/ backup /文件夹中加载备份yyyy-mm-dd /。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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