
Recientemente experimenté unproblema de vigilancia de registroeso se soluciona ejecutando export DATE_MANIP=DM5
. cron parece olvidar esto cuando cierro sesión (presumiblemente porque no está guardado).
¿Dónde puedo agregar esta variable de entorno personalizada? Como no administro el código de logwatch, no quiero agregar necesariamente un export
comando dentro del script que se inicia. Intenté agregar export DATE_MANIP=DM5
pero /root/.bash_profile
eso no ayuda cuando no estoy conectado.
CentOS 6.x
Respuesta1
Edite su /etc/cron.daily/0logwatch
secuencia de comandos y agregue export DATE_MANIP=DM5
antes de la llamada de registro.
ejemplo:
#!/bin/sh
#Set logwatch location
LOGWATCH_SCRIPT="/usr/sbin/logwatch"
#Add options to this line. Most options should be defined in /etc/logwatch/conf/logwatch.conf,
#but some are only for the nightly cronrun such as --output mail and should be set here.
#Other options to consider might be "--format html" or "--encode base64", man logwatch for more details.
OPTIONS="--output mail"
# Fix Date::Manip issue
export DATE_MANIP=DM5
#Call logwatch
$LOGWATCH_SCRIPT $OPTIONS
exit 0