problema al ejecutar scripts en el cron de root
Terra 1
torrecollons en terra.es
Jue Ene 24 22:26:52 GMT 2008
En/na Miguel A. Velasco ha escrit:
> Hola a todos, ¿alguien sabría decirme porque añado estas líneas en el
> cron de un servidor con Ubuntu y no se ejecuta nada?
>
> rootavrouter:/etc/cron.hourly# crontab -l
> # m h dom mon dow command
> 0 7 * * * /Software/scripts/sarg/daily_sarg.sh
> 50 23 * * 7 /Software/scripts/sarg/weekly_sarg.sh
> 59 23 * * 7 /Software/scripts/sarg/email_sarg.sh
> 0 22 28 * * /Software/scripts/sarg/monthly_sarg.sh
>
> Dentro de root ejecuto crontab -e y añado las líneas. Los scripts
> están correctamente ubicados y con permisos de ejecució para root. Si
> los ejecuto manualmente funcionan bien pero con el cron no funcionan.
>
> Les agradezco a todos su atención.
> Un saludo,
>
> Miguel A. Velasco
>
Hola creo que tienes que poner siempre dos digitos o sea
00 07 * * * /turuta/tuscript.sh
Otra cosa mira los mails del sistema, alli te informa de lo que ha
fallado, si no lo tienes configurado mirate esto en "/etc" tienes que
tener un fichero llamado "crontab" y dentro lo que sigue entre los #,
con eso cada acción del cron te enviara un correo que puedes ver con la
orden "mail" desde un shell,
##############################################################################
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
# 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 )
#
###############################################################################################
--
Pere
torrecollonsaterra.es <mailto:torrecollonsaterra.es>
Más información sobre la lista de distribución ubuntu-es