如何在nohup的远程服务器上运行非OTP Erlang应用程序?

时间:2011-11-18 12:06:55

标签: erlang nohup

我有一个不是OTP应用程序的Erlang代码文件。我不使用螺纹钢。

我的Erlang脚本只进行一些计算并将结果写入文件result.txt

由于运行时间可能很长,我想使用nohup在远程计算机上运行它。

然而,正在运行

nohup erl -noshell -pa ebin -eval "my_script:my_fun(Arg1,Arg2)" -s init stop &

不执行任何操作:nohup.out已创建,但仍为空,并且根本不会创建result.txt

没有nohup

的相同命令
erl -noshell -pa ebin -eval "my_script:my_fun(Arg1,Arg2)" -s init stop

工作,创建result.txt文件并返回确定。

如何通过nohup运行my_script.erl?

1 个答案:

答案 0 :(得分:1)

您需要在命令行中使用选项-detached

http://www.erlang.org/doc/man/erl.html搜索“独立”