使用nohup运行JMeter脚本

时间:2016-05-16 12:58:48

标签: bash shell jmeter nohup

我第一次在Ubuntu服务器上玩nohup。我阅读了几篇关于nohup的文档,并通过nohup ./server.sh &等选项了解了运行命令。

我想知道的是,我应该如何使用JMeter运行nohup脚本(无头模式)?以下是我需要使用nohup运行的脚本:

./jmeter.sh -n -t /home/chamith/WSO2MB/new/apache-jmeter-2.13/bin/GamesSubscriber.jmx

当我尝试在脚本中使用正常的nohup操作时,它总是会抛出一个错误-n command not found。我该如何继续这个?任何帮助,将不胜感激。

1 个答案:

答案 0 :(得分:6)

虽然我无法重现您的问题,但您可以尝试使用引号括起命令:

nohup "./jmeter.sh -n -t /home/chamith/WSO2MB/new/apache-jmeter-2.13/bin/GamesSubscriber.jmx"

也不要忘记-l键将结果保存到文件中。

在后台完全运行脚本的完整命令如下所示:

nohup "./jmeter.sh -n -t /home/chamith/WSO2MB/new/apache-jmeter-2.13/bin/GamesSubscriber.jmx -l result.jtl" > /dev/null 2>&1 &

参考文献:

相关问题