Skip to content

Commit

Permalink
Add systemd timer to rotate database
Browse files Browse the repository at this point in the history
  • Loading branch information
thkukuk committed Jun 7, 2023
1 parent 6ba0ff8 commit 8d762d4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions units/meson.build
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
install_data('wtmpdb-update-boot.service', install_dir : systemunitdir)
install_data('wtmpdb-rotate.service', install_dir : systemunitdir)
install_data('wtmpdb-rotate.timer', install_dir : systemunitdir)
11 changes: 11 additions & 0 deletions units/wtmpdb-rotate.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Rotate wtmpdb
Documentation=man:wtmpdb(8)
RequiresMountsFor=/var/lib/wtmpdb

[Service]
Type=oneshot
ExecStart=/usr/bin/wtmpdb rotate
Nice=19
IOSchedulingClass=best-effort
IOSchedulingPriority=7
11 changes: 11 additions & 0 deletions units/wtmpdb-rotate.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Monthly rotation of wtmpdb
Documentation=man:wtmpdb(8)

[Timer]
OnCalendar=monthly
RandomizedDelaySec=900
Persistent=true

[Install]
WantedBy=timers.target

0 comments on commit 8d762d4

Please sign in to comment.