php nohup ile birden kabuk komutları çalıştırmak

0 Cevap php

I want to execute multiple shell-commands with php's exec command. The commands have to be made sequentially and I want to start them with nohup so it can run in the background and my php-script doesn't have to wait for it to finish. Here's my script:

$command1="nohup convert -trim +repage pic1.png pic2.png; convert pic2.png -thumbnail 500x10000 pic3.png; convert pic2.png -resize 115x1000 -gravity Center -crop 115x196+0+0  +repage pic4.png; rm pic1.png; rm pic2.png > /dev/null 2> /dev/null & echo $";
$output = exec($command1 . ' 2>&1', $output, $return);

Gördüğünüz gibi, ben daha önce kesilmiş olan bir resmi düzenlemek istiyorum çünkü sıralı olması gerekir. Kendisi komuta ve sıralı bir parçası iyi çalışır, ancak nohup bütün $ command1 çalışmaz. Aslında bir şey yapmak ya da sadece son komutu (rm pic2.png) çalışır yoksa ben emin değilim.

Any help is greatly appreciated. Thanks

0 Cevap