cupcakearmy / autorestic

Config driven, easy backup cli for restic.
https://autorestic.vercel.app/
Apache License 2.0
1.16k stars 68 forks source link

'locations[storage]' has invalid keys: forgetoption #351

Open ajaskiewiczpl opened 5 months ago

ajaskiewiczpl commented 5 months ago

Running autorestic backup -a or autorestic check (for second time) gives error:

1 error(s) decoding:

* 'locations[storage]' has invalid keys: forgetoption
Could not parse config file!

Environment

Additional context My yaml file:

version: 2

locations:
  storage:
    from: /mnt/storage/test
    to: azure
    forget: prune
    options:
      backup:
        exclude:
          - "*.log"
          - "*.tmp"
      forget:
        keep-within: "90d"
    hooks:
      before:
        - docker stop test
      after:
        - docker start test
      failure:
        - echo "Something went wrong"
      success:
        - echo "Well done!"

backends:
  azure:
    type: azure
    path: "myserver:backup/storage"
    env:
      AZURE_ACCOUNT_NAME: redacted
      AZURE_ACCOUNT_KEY: redacted
      AZURE_ACCOUNT_SAS: redacted
ilium007 commented 5 months ago

Same

autorestic --version
autorestic version 1.7.10
Ivan-Malinovski commented 4 months ago

Same here, tried with rest-server backend version 1.7.11

mariomare22 commented 4 months ago

This worked for me

    options:
      backup:
        exclude:
        - /mnt/3
        - /mnt/2
        - /mnt/1
      forget:
        keep-last:
        - 10
        forgetoption: prune
nickelswitte commented 2 months ago

For me, the line with forgetoption was automatically inserted by autorestic, after I initialized a new repository. I could also solve the issuet temporarily, by removing the whole line completely from the .autorestic.yml. But the issue reappears when initializing the next repository.

Is this intended behavior? And where is the documentation on this forgetoption. Is this to be found in the docs of autorestic, or of restic itself?

Also, on a side note: I am using comments and extra spacing in my .autorestic.yml to make it more understandable and managable, but all of this is removed with the next repository initialization. Is this intended behavior?