cron kurulum için

3 Cevap php

Ben zaten cron işi planladı var. Şimdi ben kimin cron benim dosya 09:00 çalışmalıdır böyle kurulum, 11:00, 01:00, 05:00 ve 19:00 gereken bir dosya var

Idont Yani herkes aboove verilen zamanlamaları benim dosya için bu cron'u kurma lütfen bana yardımcı olabilir cron'nun hakkında çok fikrim var!

3 Cevap

CRON İşler için biçimi:

minute hour dom month dow user cmd


minute This controls what minute of the hour the command will run on, and is between '0' and '59'


hour This controls what hour the command will run on, and is specified in the 24 hour clock, values must be between 0 and 23 (0 is midnight)


dom This is the Day of Month, that you want the command run on, e.g. to run a command on the 19th of each month, the dom would be 19.


month This is the month a specified command will run on, it may be specified numerically (0-12), or as the name of the month (e.g. May)


dow This is the Day of Week that you want a command to be run on, it can also be numeric (0-7) or as the name of the day (e.g. sun).


user Bu komutu çalıştırır kullanıcı.


cmd This is the command that you want run. This field may contain multiple words or spaces.


If you don't wish to specify a value for a field, just place a * in the field.


Burada crontab kurulum kadar bir örnektir.

01 * * * * root echo "This command is run at one min past every hour"
17 8 * * * root echo "This command is run daily at 8:17 am"
17 20 * * * root echo "This command is run daily at 8:17 pm"
00 4 * * 0 root echo "This command is run at 4 am every Sunday"
* 4 * * Sun root echo "So is this"
42 4 1 * * root echo "This command is run 4:42 am every 1st of the month"
01 * 19 07 * root echo "This command is run hourly on the 19th of July"

Each of the positions means a specific thing:

  1. Dakika [0,59]
  2. Saat [0,23]
  3. Ayın Günü [1,31]
  4. Yılın ay [1,12]
  5. Haftanın günü ([0,6] 0 = Pazar ile)

Örneğin:

0 9,11,13,17,19 * * * /bin/whatever >> /some/log/if/you/want/it.log

In English:

Çalıştır / bin / her ayın 9, 11, 13, 17 ve 0 dakika ve her gün 19 saat, haftanın her günü ne olursa olsun.

0 9,11,13,17,19 * * * something

man 5 crontab