Jeremy Monnet a écrit :
On 4/17/07, Emmanuel Bouthenot kolter@openics.org wrote:
Est-ce qu'il est possible avec cron d'executer une commande le premier mardi de chaque mois ? :-) Executer une commande le premier, facile ! le mardi, facile ! mais le premier mardi de chaque mois ?
0 6 1-7 * 2 : de tête, chaque premier mardi du mois à 6h
Je viens de voir ça, en effet, toutefois le man de crontab (sur sun, au cas où ce serait différent ailleurs) indique :
0 0 1,15 * 1 would run a command on the first and fifteenth of each month, as well as on every Monday.
"as well as" me chagrine un peu !?
Je confirme, mon man dit 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.
Je vais essayer, je verrai bien ! Merci pour la réponse ! :-)
Sinon, pour reprendre ce que dit Vincent, un "wrapper", mais dans la ligne de cron genre 0 6 * * 2 [ $(/bin/date '+%d') -lt 8 ] && /le/script/a/lancer/le/1er/mardi/du/mois devrait marcher...
Daniel
Jeremy