mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-25 22:21:04 +01:00
Compare commits
No commits in common. "585f3afa08826317eaa2f735d0d9c6cc00d0c1dd" and "e17cb201233d9698241b103c5da39cd8d42b1770" have entirely different histories.
585f3afa08
...
e17cb20123
@ -24,7 +24,7 @@ on_calendar_backup_remote_to_local: "*-*-* 21:30:00"
|
||||
|
||||
## Schedule for Maintenance Tasks
|
||||
on_calendar_heal_docker: "*-*-* {{ hours_server_awake | join(',') }}:30:00"
|
||||
on_calendar_defrost: "*-*-* *:00,15,30,45:00"
|
||||
on_calendar_defrost: "*-*-* 00:00:00"
|
||||
on_calendar_renew_lets_encrypt_certificates: "*-*-* 12,00:30:00"
|
||||
on_calendar_deploy_mailu_certificates: "*-*-* 13,01:30:00"
|
||||
on_calendar_msi_keyboard_color: "*-*-* *:*:00"
|
||||
|
@ -2,4 +2,5 @@
|
||||
systemd:
|
||||
name: backup-data-to-usb.service
|
||||
state: reloaded
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
@ -1,6 +1,7 @@
|
||||
- name: "reload backup-docker-to-local.service"
|
||||
systemd:
|
||||
name: backup-docker-to-local.service
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "restart backup-docker-to-local.timer"
|
||||
|
@ -1,8 +1,8 @@
|
||||
- name: "reload backup-remote-to-local service"
|
||||
systemd:
|
||||
name: backup-remote-to-local.service
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "restart backup-remote-to-local timer"
|
||||
systemd:
|
||||
name: backup-remote-to-local.timer
|
||||
|
@ -100,16 +100,11 @@ def freeze(filtered_services, timeout_sec):
|
||||
attempt = wait_for_all_services_to_stop(filtered_services, max_attempts, attempt, break_time_sec)
|
||||
print("All required services have stopped.")
|
||||
|
||||
def defrost(filtered_services,timeout_sec):
|
||||
def defrost(filtered_services):
|
||||
"""
|
||||
Defrost services by starting and enabling their timers.
|
||||
"""
|
||||
break_time_sec = 5
|
||||
attempt = 0
|
||||
max_attempts = timeout_sec / break_time_sec
|
||||
wait_for_all_services_to_stop(filtered_services, max_attempts, attempt, break_time_sec)
|
||||
|
||||
for service in filtered_services + [f"system-maintenance-service-{action}"]:
|
||||
for service in filtered_services:
|
||||
print(f"Unfreezing: {service}")
|
||||
if service_file_exists(service, "timer"):
|
||||
timer_name = f"{service}.timer"
|
||||
@ -140,7 +135,7 @@ def main(services, ignored_services, action, timeout_sec):
|
||||
freeze(filtered_services, timeout_sec)
|
||||
elif action == 'defrost':
|
||||
print("Unfreezing services.")
|
||||
defrost(filtered_services, timeout_sec)
|
||||
defrost(filtered_services)
|
||||
print("Overview:")
|
||||
subprocess.run(['systemctl', 'list-timers'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user