navigation
Home
admin
|
Crontab
October 18th, 2016
|
Vous souhaitez configurer votre crontab de telle sorte qu'un programme s'exécute le premier lundi de chaque mois ?
Et vous imaginez qqch comme ça :
15 13 1-7 * 1 root /root/monscript |
Et bien non ! ca ne fonctionne pas !
Extrait :
>it is impossible to set up a job to run "every
> Friday between the 5th and the 15th".
>
> Plus the current behaviour is a bit inconsistent. The other fields are
> combined with a logical AND (ie: month AND day of month AND hour AND
> minute), whereas the day of month and day of week fields are combined
> with a logical OR.
But it's probably standard, documented behavior since 1970 so not
reasonable/possible to change. |
Source : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=460070
Une solution :
15 13 1-7 * * root [ $(/bin/date "+\%w") -eq 1 ] && /root/monscript |
à l'antislash (\) devant le %
|
|
Contact
|
|---|
Pour m'envoyer un mail, Pour me laisser un commentaire :richard.brunooo chez gmail.com |  |
|
|