On Fri, 2024-12-13 at 17:44 +0100, Jan Claeys wrote: > Assuming this backup is started by an automated system under control of > the sysadmins, and not by the users themselves, it's probably easiest > to use some sort of "lock" that is set by the backup process itself (or > that you wrap around it).
Set up a systemd timer job for automatic backups, using WakeSystem=true to make RTC resume the system if it is suspended during when the backup is scheduled to run. Then wrap the backup command with "systemd-inhibit --what=idle" to keep the system awake during the backup process. The only problem I've seen with this setup is that even with After=network-online.target nss-lookup.target Wants=network-online.target nss-lookup.target the network isn't always fully online when the job starts. Does anyone know a reliable way of ensuring that with systemd configuration (without workarounds like sleep-before-starting)? Any why doesn't network-online.target work when resuming from sleep?