Files
computer-playbook/roles/svc-bkp-local-2-device/templates/systemctl.service.j2
kevinveenbirkenbachandClaude Fable 5 904072237c feat(svc-bkp-local-2-device): scheduled device sync when mounted
Adds a nightly timer (02:00, after the secrets snapshot) next to the
existing plug trigger. ConditionPathIsMountPoint on the unit makes an
unmounted tick a silent condition-skip instead of a failure, so the
schedule only ever acts when the device is currently plugged in.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 01:47:52 +02:00

12 lines
374 B
Django/Jinja

[Unit]
Description=Backup to USB when mounted to {{ BACKUP_TO_USB_MOUNT }}
Wants={{ BACKUPS_SERVICE_MNT_NAME }}
ConditionPathIsMountPoint={{ BACKUP_TO_USB_MOUNT }}
OnFailure={{ SYS_SERVICE_ON_FAILURE_COMPOSE }}
[Service]
Type=oneshot
ExecStart={{ system_service_script_exec }} {{ BACKUP_TO_USB_SOURCE }} {{ BACKUP_TO_USB_DESTINATION }}
[Install]
WantedBy=multi-user.target