You are not logged in.

#1 2019-09-03 18:59:29

illywo
Member
Registered: 2019-07-17
Posts: 4

ssh certificate issue for rsync backup via systemd timer

Hi folks,

I ran into some trouble with a custom rsync backup script on my laptop. I've always wanted to automate the backup process with anacron. Since i could not get this to work properly I decided to run my script with a systemd timer.

While the actual script runs flawlessly if executed by my (as user) it fails when executed by the systemd timer. Since I use a ssh certificate to login to my NAS I assume, that this is where the problem comes from. In the log is says something like 'authentication failure' (have to look it up).

Is the systemd timer executed by the system? If so, how can my personal ssh certificate be used for an authentication with the timer?

Cheers

Offline

#2 2019-09-03 19:02:28

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: ssh certificate issue for rsync backup via systemd timer

man systemctl | less -p --user

Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-09-03 19:07:16

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: ssh certificate issue for rsync backup via systemd timer

Using cron is simple to run your shell script.  As jasonwryan points out, you can also make a user a timer unit.

Example timer and service: https://github.com/graysky2/modprobed-d … aster/init
Install to /usr/lib/systemd/user/ for example.

Offline

Board footer

Powered by FluxBB