İş Finish PHP komut zamanlama nasıl (CLI)

0 Cevap php

I am processing a big .gz file using PHP (transfering data from gz to mysql) it takes about 10 minutes per .gz file. I have a lot of .gz file to be processed.

PHP bir dosya ile tamamlandıktan sonra elle başka. Gz dosyasını seçin ve ardından tekrar elle komut dosyasını çalıştırmak için PHP komut dosyası değiştirmek zorunda.

I want it to be automatically run the next job to process the next file. the gz file is named as 1, 2 ,3, 4, 5 ... I can simply make a loop to be something like this ( process file 1 - 5):

for ($i = 1 ; $i >= 5; $i++)
{
    $file = gzfile($i.'.gz')
    ...gz content processing...
}

Gz dosyası gerçekten büyük olduğundan ben bu döngüyü kullanırsanız, PHP tek bir komut iş gibi birden büyük gz dosyalarını çalıştırmak çünkü Ancak, ben, bunu yapamam. (Bellek bir sürü alır)

PHP Ben sonraki dosyayı işlemek için yeni bir iş istediğim bir iş bittikten sonra ne ben yapmak istiyorum.

belki onun böyle bir şey olacak:

    $file = gzfile($_GET['filename'].'.gz')
    ...gz content processing...

Thank You

0 Cevap