It would not be a problem for this case, but imagine that I am running a backup job or evening some billing job and the session terminated unexpectedly. It would be a nightmare. Fortunately, using 'screen' command may make our life easier.
So when you need to run a command, don't run "top" but "screen top" instead. There're no different, right? How about type "Ctrl-A" and "d"? You'll see your console again, with a word "[detached]". This means you have detached a session which is running the command "top".
Can't get the idea? Type "screen -ls", you'll see the sessions in the system.
$ screen -ls
There are screens on:
2963.pts-0.server (Detached)
The 'top' is still running, but in a detached session. You can attach the session anytime at anywhere. Just run "screen -r
So next time when you want to run a command that may take a certain of time and you're not sure you can maintain the
Ref: http://www.rackaid.com/resources/tips/linux-screen.cfm
No comments:
Post a Comment