当时间戳每次都不同时,如何使用 rsnapshot 备份 SVN 存储库?
我想要使用 rsnapshot 备份 Linux 计算机上的本地磁盘 SVN 存储库。我知道我不能只是将其备份到文件系统上,因此在每个快照之前我都会使用“svnadmin hotcopy”制作一个副本。但是,每次我进行热复制时,生成的文件都具有当前时间戳,而不是与原始文件相同的时间戳。这意味着我失去了 rsnapshot 提供的写时复制式磁盘空间节省功能。
我想到的一种解决方案是让一个脚本查看热拷贝 ($DEST) 中的所有文件,并为每个文件 x,根据文件 $SOURCE/x 设置时间戳。我不知道是否有办法让 rsync 在 Linux 上执行此操作(我知道您可以在 Windows 上的 Robocopy 中执行此操作:) 我确信它可以通过 find 和 touch 完成。
欢迎提出如何执行此操作或其他解决方案的建议。我不想使用增量 svn 转储,因为我希望每个时间点快照都是当时存储库的完整副本。
I want to have rsnapshot backup a local on-disk SVN repository on a Linux machine. I know I can't just back it up off the file system, so before each snapshot I am making a copy with 'svnadmin hotcopy'. However, every time I do a hotcopy, the resulting files all have a current timestamp, rather than the same timestamp as the original file. This means I lose the ability to do the copy-on-write-esque disk space saving that rsnapshot gives.
One solution I have thought of is to have a script look at all the files in the hotcopy ($DEST) and for each file x, set the timestamp based on the file $SOURCE/x. I don't know if there is a way to make rsync do this on Linux (I know you can do it in Robocopy on Windows :) I'm sure it can be done with find and touch however.
Suggestions how to do this, or other solutions, welcomed. I'd rather not use incremental svn dumps, as I want each point-in-time snapshot to be a full copy of the repository at that time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,更改所有文件上的时间戳并不那么困难:
这将确保热复制备份中存在的文件上的时间戳与其父级具有相同的时间戳,这意味着只有在更新原始文件时才应更新它们。
Turns out changing the timestamps on all the files wasn't that difficult:
This will ensure that the timestamps on files that exist in the hot-copy backup have the same timestamp as their parent, meaning they should only be updated when you update the original.