Files
varlog/805084fe-172b-442a-bfa1-8d5f8e591515/index.md
T
2026-05-15 10:37:48 +02:00

53 lines
1.4 KiB
Markdown

# logrotate, épure-moi ces logs que je ne serai voir
## Exemple pour Apache2
```
/home/www-data/logs/apache2/*.log {
daily
missingok
rotate 31
notifempty
create 640 root
sharedscripts
postrotate
if /etc/init.d/apache2 status > /dev/null ; then \
/etc/init.d/apache2 reload > /dev/null; \
fi;
endscript
prerotate
if [ -d /etc/logrotate.d/www-data-prerotate ]; then \
run-parts /etc/logrotate.d/www-data-prerotate; \
fi; \
endscript
}
/home/www-data/www/storage/abonnel.fr/cloud/data/nextcloud.log {
su www-data www-data
daily
missingok
rotate 2
notifempty
create 640 www-data
sharedscripts
}
/home/www-data/logs/load/load.log {
su www-data www-data
daily
missingok
rotate 3
notifempty
create 640 www-data
sharedscripts
}
/home/www-data/logs/certbot/certbot.log {
su www-data www-data
daily
missingok
rotate 30
notifempty
create 640 www-data
sharedscripts
}
```