๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ปTech/๐ŸงLinux37

[๋ฆฌ๋ˆ…์Šค] ์„œ๋ฒ„ ํ•œ๊ธ€ ์„ค์ • ๋ฆฌ๋ˆ…์Šค์—์„œ vi ๋˜๋Š” ๋ฐ๋ชฌ ๋“ฑ ์‹คํ–‰ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ˆ˜ํ–‰ํ•ด์„œ ํ•œ๊ธ€์„ ๋‹ค๋ค„์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋Š”๋ฐ, ๋ณ„๋„๋กœ ์„ค์ •์„ ํ•ด์ฃผ์ง€ ์•Š์œผ๋ฉด ํ•œ๊ธ€๊นจ์ง ๋ฌธ์ œ๋กœ ํŒŒ์ผ์„ ์ œ๋Œ€๋กœ ์‚ฌ์šฉํ•  ์ˆ˜๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿด ๊ฒฝ์šฐ ๊ฐ„๋‹จํ•˜๊ฒŒ ์•„๋ž˜ ์„ค์ • ์ถ”๊ฐ€ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. profile ํŒŒ์ผ์— export ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ์‹คํ–‰ํ•˜๊ณ ์ž ํ•˜๋Š” ๋ฐ๋ชฌ, ์Šคํฌ๋ฆฝํŠธ์— ์ถ”๊ฐ€ํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค. $ vi /etc/profile ------------------------- export LANG="ko_KR.UTF-8" ------------------------- 2019. 5. 16.
[๋ฆฌ๋ˆ…์Šค] I/O Error ๋””์Šคํฌ ์ฐพ๋Š” ๋ช…๋ น์–ด ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„ ์„œ๋น„์Šค ์ž‘๋™์— ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธฐ๊ฑฐ๋‚˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ ์ฐพ์•„๋ณด๋ฉด ์žฆ์€ ๊ฒฝ์šฐ๋กœ Disk I/O Error๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํ•ด๋‹น ๋””์Šคํฌ ์ ‘์†ํ•ด์„œ ls ๋ช…๋ น์–ด๋กœ ์ผ์ผ์ด ์กฐํšŒํ•ด๋ณด์ง€ ์•Š๊ณ  Error ๊ฒฝ๋กœ๊ฐ€ ๋ฐ”๋กœ ํ™•์ธ๋ฉ๋‹ˆ๋‹ค. ๐Ÿ’ก dmesg ๋ช…๋ น์–ด๋กœ ํ•œ ๋ฒˆ์— i/o error ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” Disk(/dev/sde) ํ™•์ธ dmesg๋Š” ์‹œ์Šคํ…œ ๋ถ€ํŒ… ๋ฐ ๋™์ž‘ ์ค‘์— ์ปค๋„(kernel)์—์„œ ์ƒ์„ฑ๋œ ๋กœ๊ทธ ๋ฉ”์‹œ์ง€๋ฅผ ํ‘œ์‹œํ•˜๋Š”๋ฐ ์‚ฌ์šฉ $ dmesg -T | grep 'I/O error' -------------------------------------------------------------------- EXT4-fs (sde): previous I/O error to superblock detected.. 2019. 5. 16.
[๋ฆฌ๋ˆ…์Šค] ๊ณผ๊ฑฐ ๋ฐ์ดํ„ฐ ๊ธฐ๊ฐ„๋ณ„ ์‚ญ์ œ ๋ช…๋ น์–ด (find์‚ฌ์šฉ) ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„ ๊ด€๋ฆฌํ•  ๋•Œ ํŠน์ • ๊ฒฝ๋กœ์— ๋ฐ์ดํ„ฐ๋ฅผ ์ฃผ๊ธฐ์ ์œผ๋กœ ์‚ญ์ œํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์•„๋ž˜ ๋ช…๋ น์–ด crontab์— ๋“ฑ๋กํ•˜์—ฌ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค. ## 7์ผ ์ „ ํŒŒ์ผ ์‚ญ์ œ find /data1/data/log/* -type f -mtime +7 -exec rm -rf {} \; find /var/log/service/ -type f -mtime +7 -delete ## 7์ผ ์ „ ๋””๋ ‰ํ† ๋ฆฌ ์‚ญ์ œ find /data1/data/log/* -type d -mtime +7 -exec rm -rf {} \; 2019. 5. 16.
[๋ฆฌ๋ˆ…์Šค] shell ์Šคํฌ๋ฆฝํŠธ ๋กœ๊ทธ ์ถœ๋ ฅ์—†์ด ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์‹คํ–‰ โ—พ ์‹คํ–‰ ๋ช…๋ น์–ด์— &>/dev/null ๋ถ™์—ฌ ์ฃผ์‹œ๋ฉด ๋กœ๊ทธ ์ถœ๋ ฅ ์—†์ด ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค $ sh test.sh &>/dev/null & โ—พ CLI์— ๋กœ๊ทธ ๋‚จ๊ธฐ์ง€ ์•Š๊ณ  ํŒŒ์ผ์— ๋กœ๊ทธ ์ €์žฅํ•˜๋Š” 2๊ฐ€์ง€ ๋ฐฉ๋ฒ• ์ง€์ •ํ•œ ํŒŒ์ผ์— ๋กœ๊ทธ ์ €์žฅ nohup ํŒŒ์ผ์— ๋กœ๊ทธ ์ €์žฅ $ sh test.sh > test.log 2>&1 & $ nohup sh test.sh & 2019. 5. 16.
[SOLVED] wget: unable to resolve host address Error ๋ฆฌ๋ˆ…์Šค์—์„œ wget ์‚ฌ์šฉํ•˜์—ฌ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œํ•  ๊ฒฝ์šฐ ๋‚˜๋Š” ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค. ์ €๋Š” 2๊ฐ€์ง€ ์—๋Ÿฌ๊ฐ€ ๋‚˜์„œ ์ •๋ฆฌํ•ด ๋ดค์–ด์š”. ๐Ÿšซ Error 1 wget: unable to resolve host address ๐Ÿ’ก SOLVED 1 resolv.conf ๋ฌธ์„œ์— nameserver 8.8.8.8 ์ถ”๊ฐ€ํ•ด์ค๋‹ˆ๋‹ค. sudo vi /etc/resolv.conf nameserver 8.8.8.8 ----->์ถ”๊ฐ€ nameserver 8.8.8.8๋Š” ๊ตฌ๊ธ€ DNS ์ฃผ์†Œ์ž…๋‹ˆ๋‹ค. ๊ตฌ๊ธ€ DNS๋ฅผ ์ด์šฉํ•ด์„œ ๋‹ค์šด๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ• ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋„ค์ž„์„œ๋ฒ„๋ฅผ ์ถ”๊ฐ€ํ•ด ์ฃผ๊ณ  wget์„ ์ด์šฉํ•˜์—ฌ ๋‹ค์‹œ ๋‹ค์šด ๋ฐ›์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‹ค ๋ณด๋ฉด ๋˜ ๋‹ค๋ฅธ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค... ์ € ๊ฐ™์€ ๊ฒฝ์šฐ๋Š”... ๐Ÿšซ ERROR 2 cannot verify archive.apache.org's.. 2016. 5. 20.