티스토리 뷰
A UNIX "process" is an instance of a running program
Listing Process : ps, top
{
$ top
System: vm189 Thu Jun 22 17:28:09 2017
Load averages: 2.54, 2.72, 3.67
214 processes: 149 sleeping, 65 running
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 2.66 0.2% 99.2% 0.6% 0.0% 0.0% 0.0% 0.0% 0.0%
1 2.41 1.8% 96.4% 1.8% 0.0% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 2.54 1.0% 97.8% 1.2% 0.0% 0.0% 0.0% 0.0% 0.0%
System Page Size: 4Kbytes
Memory: 481420K (203968K) real, 858700K (359832K) virtual, 309396K free Page# 1
/20
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
1 ? 5072 user7 249 24 4008K 236K run 11:18 61.66 61.55 user7.ou
1 pts/ts 5287 user6 249 24 4008K 236K run
.....
}
Starting Process in the Background : cmd.out &
$ cat a.c
main(){
for(;;);
}
$ cc a.c -o user11.out
$ user11.out &
[1] 4086
$ nohup user11.out &
Sending output to nohup.out
[1] 4741
Termination Processes : kill
$ ps -ef |grep user11.out
user11 4741 1 254 16:56:45 ? 1:59 user11.out
$ kill 4741
$ ps -ef |grep user11.out
user11 5264 4919 0 17:10:35 pts/tu 0:00 grep user11.out
$ user11.out &
[1] 5409
$ ps -ef |grep user11.out
user11 5409 4919 245 17:14:22 pts/tu 0:04 user11.out
user11 5414 4919 0 17:14:32 pts/tu 0:00 grep user11.out
$ kill -s INT 5409
$
[1] + Interrupt user11.out &
Prioritizing Processes: nice
process priorities(HPUX) 0~fg20(bg24)~39
Good ~ Bad (Good 일수록 자주 CPU를 할당받는다)
A(0) 100 (100)AAA(200) (100)AAA(200) (100)AAA(200)
B(20) 150 (130)BBB(200) (100)BBB(200) (180) (160)
C(39) 200 (195) (190) (185) (180) (175)CCC(170)
//nice와 renice에서 값 감소(cpu사용도 좋아짐) 은 root만이 가능하다.
Scheduling Processes : cron
Use the cron daemon to schedule and automate routine system tasks
/var/adm/cron/cron.allow [사용자의 이름이 있어야 함]
cron Example
min : 분, * 매분
hour : 시, * 매시
date : 일, * 매일
month : 월, * 매월
day: 요일, * 매요일 [0 일, 1 월, 2 화, ... , 6 토]
command: 반드시 절대경로로 표현, 출력시 기호 > 표준출력지정 [ps -ef | grep cron, then cron's tty is unknown]
{
$ crontab -e
~ vi mode
* * 23 6 * /usr/bin/date >> /home/user11/cron.out # 2017.6.23
//cron files are stored in /var/spool/cron/crontabs/"username"
$ tail -f cron.out
Fri Jun 23 10:46:00 KST 2017
Fri Jun 23 10:47:00 KST 2017
Fri Jun 23 10:48:01 KST 2017
}
Scheduling Process : at
Use the at command to schedule on-time command execution
{
$ at now + 12 hours
mkdir /home/user11/atdir
cp /etc/passwd /home/user11/atdir
date > /home/user11/atdir/at.out
}
'IoT 과정' 카테고리의 다른 글
HPUX - Shell Programming - Branches (0) | 2017.06.23 |
---|---|
HPUX - Shell Programming (0) | 2017.06.23 |
HPUX - Pipes (0) | 2017.06.22 |
HPUX - Input and Output Redirection (0) | 2017.06.22 |
HPUX - Quoting (0) | 2017.06.21 |
- Total
- Today
- Yesterday
- 명제논리
- Grafana
- 아레나 시뮬레이션
- 엄청난 인내심과 시뮬레이션을 위한 아레나 툴
- grafana cloud
- 시뮬레이션
- Discrete Mathematics
- 그라파나
- 아레나
- javascript
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- Propositional and Predicate Logic
- 로젠
- 데이터 중심 애플리케이션 설계
- Arena
- 자바스크립트 예제
- 최단경로 알고리즘
- arena simulation
- 아레나시뮬레이션
- 이산수학
- Simulation
- 대규모 시스템 설계 기초
- 항해99
- 백준
- 자바스크립트
- rosen
- flutter
- beginning javascript
- paul wilton
- 이산 수학
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |