Open
Description
The copy
command may copy duplicated blob.
How to reproduce:
- Prepare a file that is large enough, for example,
ffmpeg.exe
- Copy
ffmpeg.exe
toffmpeg2.exe
,ffmpeg3.exe
- Create a config file like this:
[repository]
repository="source"
password="123456"
[[copy.targets]]
repository="target"
password="789012"
- Save the config file as
config.toml
. - Create some snapshots:
rustic -P config backup ffmpeg.exe
rustic -P config backup ffmpeg2.exe
rustic -P config backup ffmpeg3.exe
- Copy source to target:
rustic -P config copy
- Compare sizes of two repositories and the target repository will be larger.
- Prune the target repository and it will reported that there are unused data.
It seems that when copying data blobs in src/command/copy.rs
, the index is not updated so duplicate data blobs are copied.
I realized this when copying a 300GB repo into a 512GB hard disk and encountered a surprising disk full.