Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diaoul/restic-backup
Minimalist restic backup with systemd
https://github.com/diaoul/restic-backup
Last synced: about 1 month ago
JSON representation
Minimalist restic backup with systemd
- Host: GitHub
- URL: https://github.com/diaoul/restic-backup
- Owner: Diaoul
- License: unlicense
- Created: 2021-09-13T19:18:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-14T13:48:39.000Z (about 1 year ago)
- Last Synced: 2024-05-02T00:29:37.316Z (7 months ago)
- Language: Makefile
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Restic Backup
Minimalist restic backup with systemd.This repository aims to provide simple and working example of how to run restic
with systemd. There is no fancy notification, no complex installation scripts,
just a few files easy to maintain and edit as required.It is assumed that you know your way around both [restic](https://restic.net/)
and [systemd](https://www.freedesktop.org/wiki/Software/systemd/).## Installation
Install the systemd files with:
```bash
sudo make install
```Install the configuration example with:
```bash
sudo make install-conf
```
**Warning:** this will overwrite any previous configuration!The Makefile honors the `DESTDIR` environment variable so if you want to
install it somewhere else to test things out, just run:
```bash
DESTDIR=/tmp/test make install
```## Configuration
The configuration is done by passing variables in `/etc/restic/restic.conf` to
restic as environment variables with systemd. Edit this file as needed.Edit the timers in `/etc/systemd/system/restic-*.timer` to adjust the backup
frequency.Edit the services in `/etc/systemd/system/restic-*.service` to change restic
arguments or clean up policy.## Security
If your system is secure, you should also protect your backups. The sensitive
files installed by `make install-conf` are owned by root with mode 600.## Usage
Enable and start the timers
```bash
sudo systemctl enable --now restic-backup.timer
sudo systemctl enable --now restic-forget.timer
```Verify the status, e.g.
```bash
sudo systemctl list-timers
sudo systemctl status restic-backup.service
```For ease of use I created a [wrapper](https://github.com/Diaoul/dotfiles/blob/main/.local/bin/restic-wrapper.sh)
script that will load the configuration before calling restic.
Then I just call `sudo restic-wrapper.sh check`.## Thanks
I used inspiration from all over internet, so thank you internet! :handshake:In particular:
* https://github.com/erikw/restic-systemd-automatic-backup
* https://github.com/larsks/restic-systemd-units