我正在尝试执行以下操作:
1)在Windows机器上的远程机器1,2和3(所有Linux)上运行shell脚本。
2)在我的Windows机器上,我有以下方式使用的plink:
plink -i <my_private_key> user@machineX.com -t "bash <script_loc> args &"
当我这样做时,预期的过程不会开始。我确认通过远程登录到machineX(1,2或or3)并键入:
ps -A -F | grep -i "whatever"
我可以通过输入命令行在命令行启动它:
cmd /c start plink -i <my_private_key> user@machineX.com -t ""bash <script_loc> args ""&""""
但这意味着它将打开一个新的终端,并在注销Windows机器后,这些将终止。
我的目标是远程启动这些脚本并使它们作为后台进程或守护进程运行。我将能够找到pid等,因为我知道它们将通过命令行运行。
如果没有创建服务,这可行吗?
问候,