Ich möchte einen Cron-Ausdruck, 6. September 2010 06.00Cron Ausdruck für aktuelle
12
A
Antwort
20
Original Frage stellt wurde mit dem Stichwort cron
so dass dieser erste Abschnitt das gilt. Im Folgenden finden Sie eine aktualisierte Antwort für das Quartz CronTrigger-Tool.
meisten crontabs lassen Sie das Jahr nicht angeben, so dass Sie wahrscheinlich, dass im Skript setzen werden müssen selbst (oder einen Wrapper um das Skript/Programm).
Sie können dies tun, mit so etwas wie:
if [[ $(date +%Y) != 2010 ]] ; then
exit
fi
Die Option für Sie suchen am 6. September um 06.00 Uhr laufen jedes Jahre ist
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).
Für die Quarz CronTrigger-Format, würden Sie etwas wie aussehen:
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).
(Details gesammelt von here).
5
Für One-Shot-Jobs ist der Befehl 'at' besser geeignet als Cron.
at -f filename 06:00 09/06/2010
1
Es konnte nur in/etc/crontab werden durch folgt:
0 6 6 9 * root test `/bin/date +%Y` == 2010 && <your command>
bitte mit jedem Feld erklären kann –
Es ya gehen, @ NewBie. – paxdiablo
von http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html wir müssen auch Stunde, Minute und Sekunde erwähnen –