Giter VIP home page Giter VIP logo

Comments (1)

YurNaybor avatar YurNaybor commented on June 18, 2024

I've built a custom image based on cupcakearmy/autorestic:1.7.9 and only added docker-cli via apk. This was enough to come one step further. Autorestic now could find the volume and started a docker run command.

Unfortunately, this also failed without error message. At least it printed the command and I was able, by running it manually, to find out that apparently it did not run restic init before running restic backup. I'm not sure if that's an configuration issue on my side or Autorestic bug. Do I have to run restic init or autorestic check manually (initially) when using cron?

Running init manually solved it an now Autorestic seems to run trough fine.

Though I am not sure if there should be output after "Executing...forget"

Using config: 	 /etc/autorestic/.autorestic.yml
Using env:	 /etc/autorestic/.autorestic.env
Using lock:	 /etc/autorestic/.autorestic.lock.yml


    Backing up location "dummy"    


Running hooks
> echo "Before"
> Executing: /bin/bash -c echo "Before"
Before

Backend: local
> Executing: /usr/bin/docker volume inspect autorestic_dummy-location
[
    {
        "CreatedAt": "2023-10-29T01:19:43-04:00",
        "Driver": "local",
        "Labels": {
            "com.docker.stack.namespace": "autorestic"
        },
        "Mountpoint": "/var/lib/docker/165536.165536/volumes/autorestic_dummy-location/_data",
        "Name": "autorestic_dummy-location",
        "Options": {},
        "Scope": "local"
    }
]
> Executing: /usr/bin/docker run --rm --entrypoint ash --workdir /data --volume autorestic_dummy-location:/data --hostname docker --volume /backends/local:/repo --env RESTIC_REPOSITORY=/repo --env RESTIC_PASSWORD=topsecret cupcakearmy/autorestic:1.7.9 -c restic backup --tag ar:cron --tag ar:location:dummy /data


Running hooks
> echo "After"
> Executing: /bin/bash -c echo "After"
After


Running hooks
> echo "Something went wrong"
> Executing: /bin/bash -c echo "Something went wrong"
Something went wrong
root@xxx:/# /usr/bin/docker run --rm --entrypoint ash --workdir /data --volume autorestic_dummy-location:/data --hostname docker --volume /backends/local:/repo --env RESTIC_REPOSITORY=/repo --env RESTIC_PASSWORD=topsecret cupcakearmy/autorestic:1.7.9 -c "restic backup --tag ar:cron --tag ar:location:dummy /data"
Fatal: unable to open config file: stat /repo/config: no such file or directory
Is there a repository at the following location?
/repo
root@xxx:/# /usr/bin/docker run --rm --entrypoint ash --workdir /data --volume autorestic_dummy-location:/data --hostname docker --volume /backends/local:/repo --env RESTIC_REPOSITORY=/repo --env RESTIC_PASSWORD=topsecret cupcakearmy/autorestic:1.7.9 -c "restic init"
created restic repository b83abed212 at /repo

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.
root@xxx:/# /usr/bin/docker run --rm --entrypoint ash --workdir /data --volume autorestic_dummy-location:/data --hostname docker --volume /backends/local:/repo --env RESTIC_REPOSITORY=/repo --env RESTIC_PASSWORD=topsecret cupcakearmy/autorestic:1.7.9 -c "restic backup --tag ar:cron --tag ar:location:dummy /data"
no parent snapshot found, will read all files

Files:           2 new,     0 changed,     0 unmodified
Dirs:            1 new,     0 changed,     0 unmodified
Added to the repository: 846 B (564 B stored)

processed 2 files, 0 B in 0:00
snapshot eb58e720 saved
Using config: 	 /etc/autorestic/.autorestic.yml
Using env:	 /etc/autorestic/.autorestic.env
Using lock:	 /etc/autorestic/.autorestic.lock.yml


    Backing up location "dummy"    


Running hooks
> echo "Before"
> Executing: /bin/bash -c echo "Before"
Before

Backend: local
> Executing: /usr/bin/docker volume inspect autorestic_dummy-location
[
    {
        "CreatedAt": "2023-10-29T01:19:43-04:00",
        "Driver": "local",
        "Labels": {
            "com.docker.stack.namespace": "autorestic"
        },
        "Mountpoint": "/var/lib/docker/165536.165536/volumes/autorestic_dummy-location/_data",
        "Name": "autorestic_dummy-location",
        "Options": {},
        "Scope": "local"
    }
]
> Executing: /usr/bin/docker run --rm --entrypoint ash --workdir /data --volume autorestic_dummy-location:/data --hostname docker --volume /backends/local:/repo --env RESTIC_PASSWORD=topsecret --env RESTIC_REPOSITORY=/repo cupcakearmy/autorestic:1.7.9 -c restic backup --tag ar:cron --tag ar:location:dummy /data

Running hooks
> echo "After"
> Executing: /bin/bash -c echo "After"
After


Running hooks
> echo "Well done!"
> Executing: /bin/bash -c echo "Well done!"
Well done!



  Forgetting for location "dummy"  

For backend "local"
> Executing: /usr/bin/restic --cache-dir /cache forget --tag ar:location:dummy --prune --keep-daily 30 --keep-weekly 52

from autorestic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.