Skip to content

Repos are not initialized if configured via JSON #627

Open
@jules2689

Description

@jules2689

Describe the bug
A clear and concise description of what the bug is.

I'm not sure if this is a bug or a feature request, but ultimately landed on considering it a bug for the purpose of this issue because it seems that backrest encourages the use of config.json, especially when restoring.

In my case, I am using Ansible to programmatically set up my computer. In my scripts I am generating a valid config.json file that includes repos and plans - Backrest has no problem detecting these, but leaves them uninitialized. This leads to checks failing, and backups cannot run. I can fix this by running init in the Run Command mode, but this is not ideal - im unsure if there are missing options (e.g. the opts variable on this line https://github.com/garethgeorge/backrest/blob/b3402a18d2026a2b5998ecdae5a9802f7b3c844a/pkg/restic/restic.go#L116C64-L116C68)

In an ideal world, backrest would loop through the repos on boot and initialize any of them that are not initialized (perhaps this can be a config in config.json!)

To Reproduce
Steps to reproduce the behavior:

  1. Fill out a config.json with repos and plans for a new instance
  2. Launch instance
    3.Go to repo and click "check now"
  3. See error like unable to open config file: stat ...

Expected behavior

Repos should either:

  • initialize on boot if uninitialized (ideal)
  • Offer a 1 click button to initialize on the repo page if uninitialized

Platform Info

  • OS and Architecture: Docker compose image garethgeorge/backrest:latest
  • Backrest Version 1.6.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions