dpc / rdedup

Data deduplication engine, supporting optional compression and public key encryption.
832 stars 42 forks source link

Copy Command or Copy Binary #111

Open phillipCouto opened 7 years ago

phillipCouto commented 7 years ago

What do you think of a reconfig command that can alter the settings of the repo like chunk size, chunking algorithm, folder nesting, etc that will allow the user to change the setting with a command have the repo transition and as little of a destructive way as possible.

I don't think we can support encryption or compression as that would require us writing the chunks in place and if interrupted we couldn't repair the repo.

Maybe we need an duplicate command for that purpose.

Thoughts?

dpc commented 7 years ago

Hmm... I was actually thinking about a command that would copy everything to a new repo:

Basically:

for name in src.names() {
    rdedup load --dir src name | rdedup store --dir dst name
}

It should be fairly easy to implement.

Rewritting in place would be tricky, as it could leave the repository half-changed which is hard to support (test, etc.).

phillipCouto commented 7 years ago

Hmm would it be just a another binary utility in the project? Like rdedup-clone?

Or just a clone command that can take a single name as an argument and the path to the destination as the second if just a single argument is provided then all names are cloned to the path of the destination repo.

What do you think?

dpc commented 7 years ago

It could be just another subcommand, I guess.

phillipCouto commented 7 years ago

The more I think about it though the more I think it should be a separate binary, following the unix model of simplicity. This way the binary and its options are specific to that function of copying names from one repo to another.

dpc commented 7 years ago

That's fine with me.