初步MQ 备注
This commit is contained in:
45
start_webman_commands.php
Normal file
45
start_webman_commands.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* 执行多个webman相关的nohup命令
|
||||
*/
|
||||
|
||||
// 定义要执行的命令列表
|
||||
//$commands = [
|
||||
// 'nohup php webman applysmstemp &',
|
||||
// 'nohup php webman birthdaygiftsms &',
|
||||
// 'nohup php webman birthdaygiftsms &',
|
||||
// 'nohup php webman rabborderprint &',
|
||||
// 'nohup php webman rabbproductupdate &',
|
||||
// 'nohup php webman sendmarksms &',
|
||||
// 'nohup php webman sendwechattemp &',
|
||||
//];
|
||||
$commands = [
|
||||
'php webman applysmstemp',
|
||||
'php webman birthdaygiftsms',
|
||||
'php webman birthdaygiftsms',
|
||||
'php webman rabborderprint',
|
||||
'php webman rabbproductupdate',
|
||||
'php webman sendmarksms',
|
||||
'php webman sendwechattemp',
|
||||
];
|
||||
echo "开始执行命令...\n";
|
||||
|
||||
// 遍历并执行每个命令
|
||||
foreach ($commands as $index => $command) {
|
||||
echo "执行第 " . ($index + 1) . " 条命令: {$command}\n";
|
||||
|
||||
// 执行命令
|
||||
$output = [];
|
||||
$returnVar = 0;
|
||||
exec($command, $output, $returnVar);
|
||||
|
||||
// 检查命令执行结果
|
||||
if ($returnVar === 0) {
|
||||
echo "命令执行成功\n";
|
||||
} else {
|
||||
echo "命令执行失败,返回码: {$returnVar}\n";
|
||||
echo "输出信息: " . implode("\n", $output) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "所有命令已提交执行\n";
|
||||
Reference in New Issue
Block a user