So I noticed that in the case of restic init --copy-chunker-params, $RESTIC_REPOSITORY2 is the SOURCE and $RESTIC_REPOSITORY is the TARGET. However, in the case of restic copy, $RESTIC_REPOSITORY2 is the TARGET, and $RESTIC_REPOSITORY is the SOURCE.
Am I the only one that finds this confusing?
I do have a feeling that I use restic copy a little backwards from everyone else, most likely. I think most people use it to copy from their main $RESTIC_REPOSITORY to an offsite / secondary $RESTIC_REPOSITORY2. I, however, tend to use it to copy from an intermediary repo $RESTIC_REPOSITORY2 to my main repo $RESTIC_REPOSITORY. The reason for this is, I occasionally backup offline devices, and have a fast SSD to do so - and it doesnât make sense for me to take my main repository offline to hook up to the offline machine. So once it starts to fill, I dump it onto my main repo.
So, I donât want to change the restic copy workflow, because I feel like Iâm a fringe case for that. I would like to see init follow copy's logic, though. Does this make sense?
So if you wanted to copy chunker params, you know that $RESTIC_REPOSITORY2 is always a TARGET. So youâd copy params from $RESTIC_REPOSITORY to $RESTIC_REPOSITORY2 - not the other way around, as it currently is.
Luckily restic will not mess with an already initialized repo, else Iâd be in trouble, because I totally got the logic messed up on this haha. Just wondering if Iâm the only one that is confused by this, or if it makes sense to everybody else.
And with all that in mind, and the fact that we now have âversion 2â repos⌠Iâd also like to suggest $RESTIC_REPOSITORY2 be renamed to something like $REPOSITORY_TARGET or something a little clearer. Make sense??
Ahh, should have known someone else would have pointed that one out by now haha. I just honestly hadnât needed to copy the chunker params before cause I typically just copy âconfigâ and âkeysâ into a new directory for my âtemporary reposâ.
That said, a big repository v2 upgrade might be just the time to nip this in the bud, especially considering ârepo2â sounds a lot like ârepo v2â
The rationale has been that the --repo one is the âmainâ repository and the --repo2 is the âsecondaryâ repository.
In the case of init, the main repository is the one you are focusing on, where you want the work to be done, in this case the one youâre initializing. The secondary one is the one which you are just picking some initialization parameters from.
In the case of copy, the main repository is the one you are copying, the one that has the stuff you are working with (the data, the backups). The secondary one is the one which you are putting the copy in.
This is not an argument or excuse, just an attempt at explaining the rationale.
Yeah, I kind of get it. Perhaps for init, it would be better if --copy-chunker-params just took the repo path of the repo you want to copy from, to avoid the confusion?
Letting --copy-chunker-params wonât work as then we have no way to pass the repository password etc.
What would be possible is to replace --repo2 with a more sensible name like --repo-src / --from-repo / etc. The copy command would the use --repo as destination and the other one as source.