[systemd-devel] anacron timer for backup job to depend on network-online.target

Thomas Koch thomas at koch.ro
Sun Mar 1 13:13:11 PST 2015


meta: is it ok to ask user questions on this list?

Hi,

I want my backup job to be triggered only, if my laptop is online. I've a 
service file and a timer file. Should I add a Wants= and After= dependency on 
network-online.target? To which file?

What is the effect, if the laptop is offline for a longer period? Will the backup 
jobs accumulate? Will a backup job trigger immediately when a connection is 
established and the job is overdue?

Regards, Thomas Koch

/etc/systemd/system/mybackup.service:
[Unit]
Description=run obnam backup

[Service]
Type=simple
ExecStart=obnam backup

/etc/systemd/system/mybackup.timer:
[Unit]
Description=schedules obnam backup

[Timer]
OnBootSec=5min
OnUnitActiveSec=8h
Unit=mybackup.service
Persistent=true

[Install]
WantedBy=multi-user.target





More information about the systemd-devel mailing list