I want to copy all “latest” snapshots from one repo to another repo.
I don’t see any error in the yq command. I have been debugging this already intensively. The qt command extracts the short ids for all “latest” snapshots.
$ echo "${mostRecentSnapshots}"
3dfc43c9 7eac1759
$ restic copy --from-repo <source> "${mostRecentSnapshots}" # does not work
enter password for source repository:
repository 5508de08 opened (version 2, compression level auto)
repository 47a8ce99 opened (version 2, compression level auto)
[0:08] 100.00% 801 / 801 index files loaded
[0:07] 100.00% 801 / 801 index files loaded
Ignoring "3dfc43c9 7eac1759": no matching ID found for prefix "3dfc43c9 7eac1759"
$ restic copy --from-repo <source> 3dfc43c9 7eac1759 # works
enter password for source repository:
repository 5508de08 opened (version 2, compression level auto)
repository 47a8ce99 opened (version 2, compression level auto)
[0:07] 100.00% 801 / 801 index files loaded
[0:07] 100.00% 801 / 801 index files loaded
Is this still a problem? I don’t see what is unclear or I am misunderstanding what you’re asking.
If you have a string with two separate words in it, and you want those two words to become each their own argument, then you shan’t quote the variable (as if you do quote it, the shell will treat it as one single argument).
So running restic copy --from-repo <source> $mostRecentSnapshots is what you want to do, no?