反向增量备份策略——显而易见的好主意还是糟糕的主意?

2作者: datastack9 天前原帖
我最近想出了一个备份策略,似乎非常简单,我以为它一定已经存在——但我在任何主流工具中都没有见过。<p>这个想法是:<p>最新的备份(带时间戳)始终包含当前源状态的完整副本。<p>任何之前的备份都存储为增量:与下一个(更新的)版本相比被删除或修改的文件。<p>没有版本号——只有时间戳。新版本可以自然地插入。<p>每次备份时:<p>1. 将当前源与最新备份进行比较。<p>2. 对于已更改或已删除的文件:将它们移动到一个新的增量文件夹(带时间戳)。<p>3. 对于新文件/已更改的文件:将它们复制到最新快照文件夹(仅在需要时)。<p>4. 可选地旋转旧的增量,以保持历史记录的可管理性。<p>这意味着:<p>最新的备份始终是一个可用的完整快照(快速恢复)。<p>通过应用反向增量,可以重建之前的版本。<p>如果源文件完好无损,系统会自我修复:损坏的备份将在下次运行时被替换。<p>只需要一个完整的副本,就像一个版本化的rsync镜像。<p>随着时间的推移,丢失旧版本的影响很小。<p>它对用户友好,因为最新的备份可以通过常规文件浏览器进行浏览。<p>示例:<p>初始备份:<p>latest&#x2F; a.txt # “Hello” b.txt # “World”<p>第二天,a.txt被更改,b.txt被删除:<p>latest&#x2F; a.txt # “Hi” backup-2024-06-27T14:00:00&#x2F; a.txt # “Hello” b.txt # “World”<p>最新版本始终在latest&#x2F;中,之前的版本可以通过反向应用增量进行重建。<p>我很好奇:这之前是否以其他名称存在过?有没有我忽视的边缘案例,使其在现实工具中不切实际?<p>期待你的想法。
查看原文
I recently came up with a backup strategy that seems so simple I assume it must already exist — but I haven’t seen it in any mainstream tools.<p>The idea is:<p>The latest backup (timestamped) always contains a full copy of the current source state.<p>Any previous backups are stored as deltas: files that were deleted or modified compared to the next (newer) version.<p>There are no version numbers — just timestamps. New versions can be inserted naturally.<p>Each time you back up:<p>1. Compare the current source with the latest backup.<p>2. For files that changed or were deleted: move them into a new delta folder (timestamped).<p>3. For new&#x2F;changed files: copy them into the latest snapshot folder (only as needed).<p>4. Optionally rotate old deltas to keep history manageable.<p>This means:<p>The latest backup is always a usable full snapshot (fast restore).<p>Previous versions can be reconstructed by applying reverse deltas.<p>If the source is intact, the system self-heals: corrupted backups are replaced on the next run.<p>Only one full copy is needed, like a versioned rsync mirror.<p>As time goes by, losing old versions is low-impact.<p>It&#x27;s user friendly since the latest backup can be browsed through with regular file explorers.<p>Example:<p>Initial backup:<p>latest&#x2F; a.txt # &quot;Hello&quot; b.txt # &quot;World&quot;<p>Next day, a.txt is changed and b.txt is deleted:<p>latest&#x2F; a.txt # &quot;Hi&quot; backup-2024-06-27T14:00:00&#x2F; a.txt # &quot;Hello&quot; b.txt # &quot;World&quot;<p>The newest version is always in latest&#x2F;, and previous versions can be reconstructed by applying the deltas in reverse.<p>I&#x27;m curious: has this been done before under another name? Are there edge cases I’m overlooking that make it impractical in real-world tools?<p>Would love your thoughts.