mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
services/logrotate: Set up log rotation for NGINX and Asterisk
This commit is contained in:
parent
bc8dc605a9
commit
11b5f5bea2
2 changed files with 26 additions and 0 deletions
25
services/logrotate.nix
Normal file
25
services/logrotate.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
services.logrotate = {
|
||||
enable = true;
|
||||
paths = {
|
||||
nginx = mkIf config.services.nginx.enable {
|
||||
path = "/var/log/nginx/*.log";
|
||||
user = "nginx";
|
||||
group = "nginx";
|
||||
frequency = "weekly";
|
||||
keep = 2;
|
||||
};
|
||||
asterisk = mkIf config.systemd.services.asterisk.enable {
|
||||
path = "/var/log/asterisk/messages";
|
||||
user = "asterisk";
|
||||
group = "asterisk";
|
||||
frequency = "daily";
|
||||
keep = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue