Can't refer to storage from CLI

I’m trying to run a prune from the CLI to try and get my storage back into reasonable usage levels.
When I run the prune command without the -storage argument it processes the first storage in my configuration file.
When I use -storage to try and target a specific storage, I always get the error:
No storage named 'StorageName' is found.
I am using StorageName as shown in the duplicacy.json file in the ~/.duplicacy-web folder. Those names are the same names I see in the web gui.

{
    "storages": [
        {
            "name": "StorageName",

etc.

CLI Command:

./duplicacy_osx_x64_2.7.2 list -storage StorageName

From the manual of the prune command

I’m running the full prune command:
./duplicacy_osx_x64_2.7.2 prune -storage StorageName -all -keep 0:1800 -keep 30:180 -keep 7:30 -keep 1:7
When I run it without specifying -storage it works on the first storage in the .json file. When I try and specify a storage name I get the error regarding No storage name found.
The issue isn’t the prune command, the issue is the -storage parameter that doesn’t work with any command.

Which folder are you running the command from: /all or /<index>? in the cat .duplicacy/preferences is the storage you are referring to present?

I’m running the command from:
/Users/username/.duplicacy-web/bin
First few lines of duplicacy.json:

{
    "storages": [
        {
            "name": "Wasabi",
            "url": "wasabi://location@s3.wasabisys.com/bucketname",
            "encrypted": true,
            "ras_encrypted": false,
            "erasure_coding": "",
            "credentials": {
                "password": "password",
                "wasabi_key": "wasabi_key",
                "wasabi_secret": "wasabi_secret"
            }
        },
        {
            "name": "OneDrive",
            "url": "odb://Duplicacy",
            "encrypted": true,
            "ras_encrypted": false,
            "erasure_coding": "",
            "credentials": {
                "odb_token": "odb_token",
                "password": "password"
            }
        }
    ],

I’ve tried with both Wasabi and OneDrive as -storage arguments, errors out with both. If I don’t specify -storage then all operations happen on Wasabi.

That won’t work. Run prune from here ~/.duplicacy-web/repositories/localhost/all, and confirm .duplicacy/preferences there contains your storage. If it does not — run prune once from UI.

OK, thanks for the information. That has allowed the command to run successfully:

hostname: ~/.duplicacy-web/repositories/localhost/all$ ~/.duplicacy-web/bin/duplicacy_osx_x64_2.7.2 prune -storage OneDrive -all -keep 0:1800 -keep 30:180 -keep 7:30 -keep 1:7
Storage set to odb://Duplicacy
2022-04-20 11:09:49.581 duplicacy_osx_x64_2.7.2[91036:8860899] Keychain Get: Error Code: -25300
Enter the path of the OneDrive token file (downloadable from https://duplicacy.com/one_start):/Users/username/.duplicacy-web/odb-token.json
2022-04-20 11:10:33.719 duplicacy_osx_x64_2.7.2[91036:8861239] Keychain Get: Error Code: -25300
Enter storage password:****************
Keep no snapshots older than 1800 days
Keep 1 snapshot every 30 day(s) if older than 180 day(s)
Keep 1 snapshot every 7 day(s) if older than 30 day(s)
Keep 1 snapshot every 1 day(s) if older than 7 day(s)

It couldn’t read the keychain or access the path to the token, but I supplied those and it now seems to be running.
Hopefully this information will help others in the future.

Any reason why can’t you run prune from the UI? The whole point of it is to avoid messing with CLI…

1 Like