Je veux une expression cron qui représente 6 Septembre 2010 06h00expression Cron pour ce jour particulier
12
A
Répondre
20
question originale a été taguée cron
donc cette première section s'applique à cela. Voir ci-dessous pour une réponse mise à jour pour l'outil Quartz CronTrigger.
La plupart des crontabs ne vous laissez pas vous préciser l'année donc probablement à le mettre dans le script lui-même (ou un emballage autour du script/programme).
Vous pouvez le faire avec quelque chose comme:
if [[ $(date +%Y) != 2010 ]] ; then
exit
fi
L'option que vous cherchez à courir à 6h du matin le 6 Septembre chaque année
0 6 6 9 * your_command_goes_here
| | | | |
| | | | +- any day of the week.
| | | +--- 9th month (September).
| | +----- 6th day of the month.
| +------- 6th hour of the day.
+--------- Top of the hour (minutes = 0).
Pour la Quartz CronTrigger format, vous seriez à la recherche de quelque chose comme:
0 0 6 6 9 ? 2010
| | | | | | |
| | | | | | +- 2010 only.
| | | | | +----- any day of the week.
| | | | +------- 9th month (September).
| | | +--------- 6th day of the month.
| | +----------- 6th hour of the day.
| +------------- Top of the hour (minutes = 0).
+--------------- Top of the minute (seconds = 0).
(détails recueillis auprès de here).
5
Pour les travaux ponctuels, la commande 'at' convient mieux que cron.
at -f filename 06:00 09/06/2010
1
Il pourrait être que dans/etc/crontab en suit:
0 6 6 9 * root test `/bin/date +%Y` == 2010 && <your command>
peut-il expliquer à chaque champ –
Il y a go, @ Débutant. – paxdiablo
de http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html nous devons également mentionner heure, minute et seconde –