1

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 1

3

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).

2
  • i ran $ nohup xterm& now after re-establishing the lost ssh connection the remote host. How can I bring up the same xterm window up??
    – rajeev
    Feb 1 at 18:57
  • nohup does not work with GUI apps. You need to start xterm normally and run rsync under nohup.
    – sds
    Feb 1 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .