我尝试了一些在SO上找到的例子,但它们似乎都不起作用。我正试图使用nohup运行我的应用程序,并将应用程序的输出追加到一个文件中。
我尝试了以下几种方法,但似乎都行不通。
nohup dotnet application.dll &> out.log &
nohup dotnet application.dll > out.log 2>&1 &
nohup dotnet application.dll > /opt/out.log &
我总是收到类似于
-bash: out.log: Permission denied
我尝试使用sudo运行应用程序,但似乎仍然无法正常工作。
nohup dotnet application.dll &
程序运行良好,但是输出被导向到了其他目录,例如/home/ubuntu/nohup.out
我做错了什么?
nohup dotnet application.dll > out.log 2>&1 &
应该可以工作。 - haccksnohup
和&
。 - melpomene