« Linux : Logrotate » : différence entre les versions
De www.yakakliker.org
(Page créée avec « === Exemple de paramètres logrotate === <syntaxhighlight lang="bash"> /var/log/unattended-upgrades/unattended-upgrades.log /var/log/unattended-upgrades/unattended-upgrades-dpkg.log /var/log/unattended-upgrades/unattended-upgrades-shutdown.log { rotate 6 monthly compress missingok notifempty } </syntaxhighlight> Catégorie:Logrotate Catégorie:Linux ») |
Aucun résumé des modifications |
||
| Ligne 12 : | Ligne 12 : | ||
notifempty | notifempty | ||
} | } | ||
</syntaxhighlight> | |||
{| class="wikitable" | |||
!Besoin | |||
!Commande | |||
|- | |||
|Tester la config sans rien changer | |||
|<code>sudo logrotate -d /etc/logrotate.conf</code> | |||
|- | |||
|Forcer une rotation maintenant | |||
|<code>sudo logrotate -f /etc/logrotate.conf</code> | |||
|- | |||
|Ne traiter qu'un fichier | |||
|<code>sudo logrotate -f /etc/logrotate.d/monapp</code> | |||
|} | |||
<syntaxhighlight lang="bash"> | |||
sudo systemctl restart logrotate.timer # relance le minuteur (pas de daemon) | |||
sudo systemctl start logrotate.service # force une exécution immédiate | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Catégorie:Logrotate]] | [[Catégorie:Logrotate]] | ||
[[Catégorie:Linux]] | [[Catégorie:Linux]] | ||
Version du 22 septembre 2026 à 10:15
Exemple de paramètres logrotate
/var/log/unattended-upgrades/unattended-upgrades.log
/var/log/unattended-upgrades/unattended-upgrades-dpkg.log
/var/log/unattended-upgrades/unattended-upgrades-shutdown.log
{
rotate 6
monthly
compress
missingok
notifempty
}
| Besoin | Commande |
|---|---|
| Tester la config sans rien changer | sudo logrotate -d /etc/logrotate.conf
|
| Forcer une rotation maintenant | sudo logrotate -f /etc/logrotate.conf
|
| Ne traiter qu'un fichier | sudo logrotate -f /etc/logrotate.d/monapp
|
sudo systemctl restart logrotate.timer # relance le minuteur (pas de daemon)
sudo systemctl start logrotate.service # force une exécution immédiate