test.out && nohup ./test 2>&1 >test.out &
最简单的方法让nohup执行后不产生日志文件,可以在nohup命令行中增加输出目标文件,并指向/dev/null。也就是 nohup ./run.sh >/dev/null &,这样可以保证nohup.out文件不会自动生成;另外也可以编辑./run.sh文件,使该运行脚本简单化。比如nohup java com.xxx.xxx.Main >/dev/null &。
test.out && nohup ./test 2>&1 >test.out &
最简单的方法让nohup执行后不产生日志文件,可以在nohup命令行中增加输出目标文件,并指向/dev/null。也就是 nohup ./run.sh >/dev/null &,这样可以保证nohup.out文件不会自动生成;另外也可以编辑./run.sh文件,使该运行脚本简单化。比如nohup java com.xxx.xxx.Main >/dev/null &。
转载于:https://my.oschina.net/u/2605948/blog/755573