My systemd timer is configured to run ever day at 3:00.
The timer gets triggered only on the first day at 3:00 and systemd list-timers
says n/a
in the Left
or Next
column.
borgbackup.timer:
[Unit]
Description=Run Borgbackup daily
[Timer]
OnCalendar=03:00:00
Unit=borgbackup.target
[Install]
WantedBy=timers.target
borgbackup.target
[Unit]
Description=Borgbackup group target
Wants=borgbackup-1.service borgbackup-2.service
[Install]
Also=borgbackup.timer
borgbackup-1.service
[Unit]
Description=Daily Borgbackup
After=network.target
[Service]
Type=simple
Environment=BORG_PASSPHRASE="..."
Environment=BORG_BASE_DIR="/home/borg"
Environment=BORG_REPO="..."
ExecStart=/bin/bash -c "/usr/bin/borg create ::$(date --iso-8601) ..."
ExecStopPost=/usr/bin/borg prune -s -d 1 -w 1 -m 1
WorkingDirectory=/home/borg
[Install]
WantedBy=default.target
The only difference between borgbackup-1 and borgbackup-2 is the repository.
borgbackup.target
?