unix and linux
linux screen
'김용환'
2014. 8. 27. 10:57
linux screen : nohup처럼 계속 리눅스 명령이 동작되게 한다.
$ screen
[detached]
(배치 작업)
$ mysql 덤프 작업
..
(ctrl + a+ d) 하면 shell로 이동
$ screen -list
There is a screen on:
23455.pts-0.alpha-google (Detached)
1 Socket in /var/run/screen/S-deploy.
$ screen -r 23455.pts-0.alpha-google
(배치 작업 확인)
http://kevinx64.tistory.com/337
http://www.rootman.co.kr/board/bbs/board.php?bo_table=linux&wr_id=557&page=5
* 사용상 유의할 점
- ctrl + c으로 프로세스 종료시에는 사용할 수 없다. ctrl + a + d로 화면을 종료(detached)시킨다.
- 터미널 비정상 종료시를 염두해서 매우 좋은 효과를 가질 수 있다. (bg, fg 안녕~)
- screen -list로 나오는 결과에 숫자.blahblah 의 숫자를 이용해서 attach 할 수 있다. (screen -r 숫자)
- attach는 오직 하나의 터미널에서만 가능하다. 누군가 독점하면 쓸 수 없다. (only one user attach)
스크린 모든 프로세스를 shutdown한다.
$ screen -wipe