This is an old revision of the document!
Backrest
Backrest is a web frontend to Restic which is my choice of backup tools for my home server. Check this page for mor einfo in Restic and how to use it for backups.
While Restic can be used from the command line and can use cron to schedule backups, navigating, checking and retrieving data might not be as intuitive from the command line.
Backrest comes to help and provides a nice web GUI to do all that, plus can be used instead of cron to performo periodical backups.
Unfortunately Backrest has a few nags at this time:
- Don't support sub-paths (must be installed on it's own subdomain)
- Cannot work with proxy authentication. On this, it's so broken that you must disable proxy auth for Backrest to work at all.
Both issues are annoying, but not blocking. Overall the UI is nice and efficient, and Backrest can be a good addition to your management web tools.
Installation
The official documentation (here) suggest to use their proivided install script, but it requires SystemD and overall put it's hands deep into root-only parts of the system, which i don't like.
fortunately, installing is really easy all you need to do is download the release, unzip, setup autostart and run it, that's it.
You want/need to run this as root to make sure it can actually access all the data it needs to backup. This could be mitigated by running as non-root, but in this case you carefully check that all the files are properly backed-up, and most probably direct restore will not work.
Binary releases can be found on this page, identify the one good for your architecture (ex: x86_64).
Since Backrest should work even when the RAID array is not mounted, you should place it under /opt/backrest instead of under /data/daemons/backrest:
mkdir /opt/backrest cd /opt/backrest wget https://github.com/garethgeorge/backrest/releases/download/<VERSION>/backrest_Linux_x86_64.tar.gz tar zvf backrest_Linux_x86_64.tar.gz
Reverse Proxy
It's really simple to run Backrest behing NGINX:
- backrest.conf
location / { proxy_pass http://127.0.0.1:9898/; #proxy_pass http://127.0.0.1:2283/; }
currently PAM auth cannot be used and Backest doesn't support sub-paths.
Startup and running
Create the usual /opt/backrest/backrest.sh script: <fine - backrest.sh> #!/bin/bash /opt/backrest/backrest -bind-address 127.0.0.1:9898 -restic-cmd /usr/bin/restic -config-file /opt/backrest/config.json -data-dir /opt/backrest/ </file>
and autostart script /etc/loca.d/21-backrest.start:
- 21-backrest.start
#!/bin/bash start-stop-daemon -b -m -p /var/run/backrest/backrest.pid -n backrest /opt/backrest/backrest.sh
make both executable of course!