ngosang / restic-exporter

Prometheus exporter for the Restic backup system
MIT License
79 stars 17 forks source link

rclone is available with restic-exporter? #18

Closed damien-reyre closed 1 year ago

damien-reyre commented 1 year ago

Hello,

I'm trying to implement rclone with your restic-exporter, but I get an error:

restic-exporter-3 | 2023-06-14 15:27:00 ERROR Unable to collect metrics from Restic. Exception: Error executing restic snapshot command: Fatal: unable to open repository at rclone:pcloud:OVH: exec: "rclone": executable file not found in $PATH Exit code: 1

image

Here my docker-compose.yaml :

image

damien-reyre commented 1 year ago

@ngosang Could you confirm rclone is working with your restic-exporter?

Thanks

koenvdheuvel commented 1 year ago

I fixed this by mounting the rclone executable from my host inside the docker container.

While I'm not sure if this is best practice. It does allow the rclone version to be in sync with the version I'm running on my host machine.

restic_exporter:
    image: ngosang/restic-exporter
    container_name: restic-exporter
    environment:
      TZ: Europe/Amsterdam
      RESTIC_REPO_URL: rclone:gd-backup:/restic
      RESTIC_REPO_PASSWORD: 
      REFRESH_INTERVAL: 1800 # 30 min
    volumes:
      - /docker:/data:ro
      - /usr/bin/rclone:/usr/bin/rclone:ro
      - /mnt/config/rclone.conf:/root/.config/rclone/rclone.conf:ro
    ports:
      - "8001:8001"
    restart: unless-stopped

Hope this helps for now :)

damien-reyre commented 1 year ago

Hello @koenvdheuvel,

Thanks for your example. It's working well.

ngosang commented 1 year ago

Thank you both. I'm not going to include rclone in the Docker image because it weights 50+ MB but I will document your solution.