Skip to content

Commit

Permalink
Add systemd units to auto-restart at a specific time.
Browse files Browse the repository at this point in the history
  • Loading branch information
seyfahni committed May 19, 2021
1 parent 7888b8e commit a1a36e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions systemd/utils/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Unit]
Description=Restart Minecraft server %i

[Service]
Type=oneshot
ExecStart=/bin/systemctl try-restart minecraft@%i.service
11 changes: 11 additions & 0 deletions systemd/utils/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Restart Minecraft server %i daily on 5:30
Requisite=minecraft@%i.service
After=valheim@%i.service

[Timer]
OnCalendar=*-*-* 5:30:00
RandomizedDelaySec=1m

[Install]
WantedBy=timers.target

0 comments on commit a1a36e3

Please sign in to comment.