0

I had a file

run.php

the code is as followed

<?php

$shell_cmd = '/usr/bin/aria2c --on-bt-download-complete ./hook.sh "http://sometorrent.com/file.torrent"';

shell_exec($shell_cmd .' 2>&1 > out.log');

echo $shell_cmd;
?>

I tried run this script via website which is

http://mywebsite.com/run.php

My browser continue loading buffering sort of, until the torrent finish, how do i run in background so it execute right away in background.

user3504335
  • 177
  • 1
  • 13

1 Answers1

1
<?php

$shell_cmd = '/usr/bin/aria2c --on-bt-download-complete ./hook.sh "http://sometorrent.com/file.torrent"';

shell_exec($shell_cmd .' > out.log &');

echo $shell_cmd;
?>

This will run the shell command in background

undefined_variable
  • 6,180
  • 2
  • 22
  • 37