While you can use nohup for getting the command running even after logged out via SSH, there are times when you need to interact with the command first before it can go on with the job, such as with rsync. In this case, you need this instead of nohup:
- run it in the foreground
- pause it (CTRL+Z)
- disown it so that it won’t be closed when you close your shell (disown -h %jobid)
- resume the job in the background (bg %jobid)
jobid is usually 1 or you don’t have to provide it.
You a slightly different procedure if the above doesn’t work:
- run it in foreground
- CTRL+Z
- bg
- disown
That’s it.