0
我想做一个脚本来记录顶部输出到我的嵌入式系统的背景中的文件。但只要我把它放在背景中,它就会退出或僵尸起来。在后台运行的东西是什么系统问题? 我的脚本如何让背景的顶部运行?它需要运行并记录输出。不死或僵尸
TOP_LOG_FILE=top_log.txt
if [ -e $TOP_LOG_FILE ] ; then
rm $TOP_LOG_FILE
fi
while true
do
echo "##"`date`"##" >> $TOP_LOG_FILE
nohup top -n 1 >> $TOP_LOG_FILE
sleep 1
echo "##xxxxxxxxxxx##" >> $TOP_LOG_FILE
done
我想执行它作为
# nohup sh top_log.sh &
[4] 3051559
appending output to nohup.out
#
[4] + Stopped (tty output) nohup sh top_log.sh
和
[5] 3121193
sh: top_log.sh: cannot execute - No such file or directory
[6] 3121194
#
[6] Done > /dev/null
[5] Done (126) top_log.sh
#
如何真正解决此问题得到什么?
你试过了-b选项吗? –
它在QNX上,我只有以下选项: top [-i数字] [-d] [-n节点] [-p优先级] i =迭代次数 d =哑终端输出 -n远程节点在 上运行-p进程优先级 – preetam
我想它等同于只使用-n和-b选项。 – preetam