SOMMAIRE :
Apache / MySQL :
Administration :
Mail :
Par défaut, la rotation des logs s'effectue à 6h25. Pour plus de facilité et de gestion des logs, il est possible d'effecuer cette rotation tous les jours à minuit précise.
Pour réaliser cela, il faut éditer le fichier des tâches CRON :
nano /etc/crontab
Par défaut, il est affiché :
# m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) #
Il suffit de modifier le fichier et de mettre :
# m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 0 0 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 30 0 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 40 0 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) #
Ainsi, la rotation des logs journaliers s'effectuent à minuit (0h00) ! Les logs hebdomadaires s'effecuent à 0h30 et pour les logs mensuels se sera à 0h40.
On relance le démon CRON pour la prise en compte des nouveaux paramétres :
/etc/init.d/cron reload