I have initialized a repo on an ARM based Synology NAS and am now trying to use SystemD to automate a monthly backup of my Plex server, but am being driven insane.
I tried to follow this tutorial (localizing to suit Ubuntu) but after hours of one problem or another with the SystemD ‘.service’ file I stripped everything right back to this:
[Unit] Description=Restic backup service [Service] Type=oneshot ExecStart=restic -r sftp://firstname.lastname@example.org:1234//restic-repo --verbose --password-file ~/.config/resticpass.txt backup /var/snap/plexmediaserver/common
Where resticpass.txt only contains the plain text repo password.
Now - this works perfectly in Bash, but not as a systemd oneshot. I find the following error when checking the status of the service after a failed run:
restic: Resolving password failed: Fatal: ~/.config/resticpass.txt does not exist
Does anyone have any ideas before my brain leaks out my ears?