I'm using Linux a lot, but I'm confused with it. Maybe it is stupid question, but whatever.
I'v logged in xterm
to remote host by ssh
. Now on the remote host i started command (rsync
, a lot of data is copied from one disk to another). I forgot to run this command in screen
. What happens when i close xterm ? Running command terminate or not ?
1 Answer
Yes, it does.
When you kill xterm
, it kills ssh
(unless you specifically instructed it to detach) which, in turn, terminates connection and thus the remote shell, which kills rsync
.
You could have prevented the trouble by using screen
, tmux
, or nohup
.
You can also use ps
to figure out whether the process is running or lsof
to figure out whether someone is reading or writing to a particular file (which rsync
is supposed to be copying).