feat: backups wake and sleep device
This commit is contained in:
parent
83c51f89a9
commit
a9f6470dc2
2 changed files with 13 additions and 1 deletions
|
|
@ -43,7 +43,16 @@
|
|||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
WakeSystem = true;
|
||||
RandomizedDelaySec = "5h";
|
||||
};
|
||||
backupCleanupCommand = ''
|
||||
loginctl list-sessions --no-legend | awk '{print $1}' | while read -r s; do
|
||||
class=$(loginctl show-session "$s" -p Class --value)
|
||||
if [ "$class" = "user" ]; then
|
||||
loginctl show-session "$s" -p LockedHint --value
|
||||
fi
|
||||
done | grep -qx no && echo "unlocked session found — skip suspend" || systemctl suspend
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue