openwares.net

Freedom & Beauty

  • Home
  • About
  • Tags
  • Categories
  • Archives
  • Search
  • Table of Contents
  • Overview

openwares

open source and free matters
987 posts
18 categories
41 tags
0%

ssh execute background jobs remotely

Posted on 2019-01-21 Edited on 2020-12-07 In GNU/Linux

ssh远程执行后台作业时,在命令行最后添加&标识并不是太好用,ssh还是会挂起,无法正常退出,可以使用nohup,并且重定向其所有的三个标准输入输出来解决:

1
2
3
ssh -T server << EOF
nohup foobar >/dev/null 2>&1 </dev/null &
EOF

References:
[1]nohup

# Debian
ssh remote execute with backquote/backtick operator
MacOSX mplayer OSD issue
© 2025 openwares
Powered by Hexo & NexT.Muse