It’s a pleasure to use restic, a simple, but powerful backup tool that follows UNIX philosophy.
So far I had almost no issues using it, apart from one related to automation and integration with systemd.
My setup consists of restic-backup.service, restic-backup.timer, restic-prune.service, restic-prune.timer.
The issue I’m experiencing is with restic-backup.service that is called by the respective timer and looks as follows:
[Unit] Description=Restic backup service [Service] Type=oneshot ExecStart=-/usr/local/bin/restic -r /media/BACKUP/ResticRepo --verbose backup --tag elementaryOS --exclude-file=/media/BACKUP/system-exclude.txt / ExecStart=-/usr/local/bin/restic -r /media/BACKUP/ResticRepo --verbose backup --tag Data --exclude-file=/media/BACKUP/data-exclude.txt /home ExecStart=-/usr/local/bin/restic -r /media/BACKUP/ResticRepo forget --keep-last 2 --tag manual --group-by tags ExecStart=-/usr/local/bin/restic -r /media/BACKUP/ResticRepo forget --keep-last 4 --keep-daily 5 --keep-weekly 3 --keep-monthly 3 --keep-yearly 2 --group-by tags EnvironmentFile=/etc/environment
When the restic-backup.service runs, it creates a backup, however, it takes longer than expected due to caching issues. Journalctl shows the following error:
unable to open cache: unable to locate cache directory: neither $XDG_CACHE_HOME nor $HOME are defined
Has anyone of you experienced this sort of problem? Do you have any idea how this could be fixed?
UPD: I use official binary: restic 0.11.0 compiled with go1.15.3 on linux/amd64