20110916

Habilitar logs de cron en Ubuntu con rsyslog - Enable cron logs in Ubuntu with rsyslog

Para poder registrar los resultados de nuestras tareas programadas de cron en Ubuntu (10.04 LTS en mi caso) con rsyslog debemos hacer lo siguiente:
 - Editamos el fichero /etc/rsyslog.d/50-default.conf
 - Descomentamos esta línea: 
     cron.*                          /var/log/cron.log
 - Podemos cambiar el nivel de logeo (debug, info, etc)
 - Reiniciamos el servicio:
     sudo reload rsyslog
 - Y a funcionar, ya sólo nos falta comprobarlo con sudo tail -f /var/log/cron.log 

En mi caso, ya estaba configurada la rotación de este log dentro del fichero /etc/logrotate.d/rsyslog así que no tengo que preocuparme de que crezca sin control.

To record the result of our scheduled cron task on Ubuntu (10.04 LTS in my case) with rsyslog, we have to:
 - Edit the file /etc/rsyslog.d/50-default.conf
 - Uncomment this line:
     cron.*                          /var/log/cron.log
 - We also can change the warning level (debug, info, etc)
 - Restart the service:
     sudo reload rsyslog
 - And that's all. We can test it with: sudo tail -f /var/log/cron.log 

In my case, the system was already configured to rotate this log on the file: /etc/logrotate.d/rsyslog so we don't have to take care about it grows out of control.

PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.

No hay comentarios: