diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2022-05-06 16:03:02 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2022-05-06 23:54:37 +1200 |
commit | 155d438e47575dd0558311c95a44f276d2950399 (patch) | |
tree | 564ff8e24849c21a3c5f17a475ab433b2894fd53 /logrotate | |
parent | Don't silence urxvtd(1) startup (diff) | |
download | dotfiles-155d438e47575dd0558311c95a44f276d2950399.tar.gz dotfiles-155d438e47575dd0558311c95a44f276d2950399.zip |
Add log rotation support for .xsession
Diffstat (limited to 'logrotate')
-rw-r--r-- | logrotate/config | 5 | ||||
-rw-r--r-- | logrotate/systemd/user/logrotate.service | 10 | ||||
-rw-r--r-- | logrotate/systemd/user/logrotate.timer | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/logrotate/config b/logrotate/config new file mode 100644 index 00000000..5a703a46 --- /dev/null +++ b/logrotate/config @@ -0,0 +1,5 @@ +compress +create 0600 +delaycompress + +include ~/.config/logrotate/config.d diff --git a/logrotate/systemd/user/logrotate.service b/logrotate/systemd/user/logrotate.service new file mode 100644 index 00000000..aeb17f7c --- /dev/null +++ b/logrotate/systemd/user/logrotate.service @@ -0,0 +1,10 @@ +[Unit] +Description=user log rotation +OnFailure=notify-email@%n + +[Service] +Type=oneshot +ConfigurationDirectory=%p +StateDirectory=%p +ExecStart=/usr/sbin/logrotate --state=%S/%p/status -- %E/%p/config +TimeoutStartSec=20m diff --git a/logrotate/systemd/user/logrotate.timer b/logrotate/systemd/user/logrotate.timer new file mode 100644 index 00000000..077aeac9 --- /dev/null +++ b/logrotate/systemd/user/logrotate.timer @@ -0,0 +1,10 @@ +[Unit] +Description=user log rotation schedule + +[Timer] +OnBootSec=1h +OnUnitActiveSec=6h +RandomizedDelaySec=5m + +[Install] +WantedBy=timers.target |