Re: Duda crontab
El Fri, 04 Mar 2011 09:17:05 +0100, Esteban Torres Rodríguez escribió:
> Necesito ejecutar un script el primer domingo de cada mes.
>
> 05 1 1-7 * 0
>
> Sería así?
Creo que no.
El manual (man 5 crontab) dice lo siguiente:
***
Note: The day of a command’s execution can be specified by two fields —
day of month, and day of week. If both fields are restricted (i.e.,
aren’t *), the command will be run when either field matches the
current time. For example, ‘‘30 4 1,15 * 5’’ would cause a command to be
run at 4:30 am on the 1st and 15th of each month, plus every Friday.
***
Es decir, entiendo que se incluirían _ambos_ valores (en tu caso la tarea
se ejecutaría los días del 1 al 7 a la 1:05 y además, todos los
domingos a esa misma hora).
...
Este usuario se preguntaba lo mismo, mira a ver si alguna de las
respuestas te sirven:
cron : how to schedule to run first Sunday of every month
http://stackoverflow.com/questions/3241086/cron-how-to-schedule-to-run-first-sunday-of-every-month
Saludos,
--
Camaleón
Reply to:
- References:
- Duda crontab
- From: Esteban Torres Rodríguez <mortenol.torres@gmail.com>