2017-04-03 4 views
0

Je veux planifier le travail cron pour mon application pour faire une tâche particulière. Comment puis-je planifier dans cette exigence?Emploi du temps Cron

Exigence: cron-data.js doit être exécuté tous les lundis au vendredi toutes les heures de 9h30 à 15h30.

Répondre

1

Ceci est juste un exemple. Vous pouvez essayer ceci et personnaliser selon votre condition.

# Use the hash sign to prefix a comment 
# +---------------- minute (0 - 59) 
# | +------------- hour (0 - 23) 
# | | +---------- day of month (1 - 31) 
# | | | +------- month (1 - 12) 
# | | | | +---- day of week (0 - 7) (Sunday=0 or 7) 
# | | | | | 
# * * * * * command to be executed 
#-------------------------------------------------------------------------- 

# Run my cron job every Monday to Friday hourly from 9:30am 
30 9 * * 1,2,3,4,5 cron-data.js 
1
30 09-15 * * 1-5 [Commad to Execute] 

30: 30 Min

09-15: 9 heures-à-15 heures

*: Chaque jour

*: Chaque mois

1-5: du lundi au vendredi