Skip to content

The copy command may copy duplicate data  #146

Open
@9-2-1

Description

@9-2-1

The copy command may copy duplicated blob.

How to reproduce:

  1. Prepare a file that is large enough, for example, ffmpeg.exe
  2. Copy ffmpeg.exe to ffmpeg2.exe, ffmpeg3.exe
  3. Create a config file like this:
[repository]
repository="source"
password="123456"

[[copy.targets]]
repository="target"
password="789012"
  1. Save the config file as config.toml.
  2. Create some snapshots:
rustic -P config backup ffmpeg.exe
rustic -P config backup ffmpeg2.exe
rustic -P config backup ffmpeg3.exe
  1. Copy source to target: rustic -P config copy
  2. Compare sizes of two repositories and the target repository will be larger.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-commandsArea: Related to commands in `rustic_core`C-bugCategory: Something isn't working as expectedC-questionCategory: Further information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions