Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php BTDownloads结束下载后停止屏幕_Php_Python - Fatal编程技术网

Php BTDownloads结束下载后停止屏幕

Php BTDownloads结束下载后停止屏幕,php,python,Php,Python,我在php代码中使用以下代码 $shell_cmd = 'sudo screen /usr/bin/python /usr/bin/btdownloadcurses "'.$selected_torrent.'" --display_interval 20 --saveas "'. $file_folder . $selected_filename.'"'; $commandRUN = '/usr/bin/nohup ' . $shell_cmd . ' >/dev/null 2>&

我在php代码中使用以下代码

$shell_cmd = 'sudo screen /usr/bin/python /usr/bin/btdownloadcurses "'.$selected_torrent.'" --display_interval 20 --saveas "'. $file_folder . $selected_filename.'"';
$commandRUN = '/usr/bin/nohup ' . $shell_cmd . ' >/dev/null 2>&1 &';
shell_exec($shell_cmd);
其目的是将BitTorrent保存到我的服务器,并作为屏幕运行,其工作正常,在后台工作


现在的问题是,当我的btdownloadscurses下载完成时,我如何自动停止屏幕,我们如何监控进度并终止屏幕,我想到了使用python脚本来实现这一点。

这是自制脚本吗?您只需获取下载进度(取决于您的脚本),下载完成后,执行
screen-X quit
I正在使用cli btdownloadscurses,bit tornado for cli linux