When i run this service, it’s not picking up the config from when i was running it from cron… i figured no big deal, ill just connect it back to the repo but when entering my password i get the below error :
kopia INTERNAL: internal server error: connect error: error opening repository: error connecting: unable to set up caching: unable to determine cache directory: neither $XDG_CACHE_HOME nor $HOME are defined
Can someone assist me in either resolving the error above, or correcting my service file to actually load the same config i was using when running from cron / cmdline?
I don’t know why $HOME is not defined in your case but you can set environment variables in systemd service files:
[Service]
Environment="HOME=/root"
I personally avoid running services as root when it isn’t necessary. That’s why I’m running kopia server as normal user and connect to this server when I need to do backups as root on the same system. This is the service file I’m currently using: