본문 바로가기

전체 글

(70)
bash 쉘스크립트 디버깅 -xv 옵션을 주면서 실행하면 디버깅 모드로 출력된다. $ bash -xv filesize.sh
Safe Reboot - Magic SysRq Key magic SysRq key는 시스템 상태에 상관 없이 사용자가 low level command를 수행할 수 있도록 해주는 커널 내부에서의 키 조합이다. (The magic SysRq key is a key combination in the Linux kernel which allows the user to perform various low level commands regardless of the system’s state.) 이것은 시스템을 복구하거나 파일시스템을 손상시키지 않고 재부팅 할 때 사용된다. 키 조합은 Alt+SysRq+CommndKey로 구성된다. 대부분의 시스템에서 SysRq 키는 printscreen 키이다. (It is often used to recover from freeze..
주기적으로 작업 실행 - cron crontab file format {minute} {hour} {day-of-month} {month} {day-of-week} {full-path-to-shell-script} * minute: 0 ~ 59 * hour: 0 ~ 23 * day-of-month: 0 ~ 31 * month: 1 ~ 12 * Day-of-week: 0 ~ 7 (일요일 : 0 또는 7) crontab에 작업 등록하기 # crontab –e 0 5 * * * /root/bin/backup.sh 매일 오전 5시에 /root/bin/backup.sh 실행 cron 예제 1. 매일 오전 12시 1분에 백업 실행 (시스템 로드가 없어서 백업하기에 적절한 시간) 1 0 * * * /root/bin/backup.sh 2. 주중(월~금..
비밀번호 없이 ssh 접속하도록 설정 Step 1. ssh-keygen으로 로컬호스트에 키 생성 yklee@tyolee:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/yklee/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/yklee/.ssh/id_rsa. Your public key has been saved in /home/yklee/.ssh/id_rsa.pub. The key fingerprint is: f2:b2:ca:5f:..
swap 영역 설정하기 1. 스왑용 파일 만들기 # dd if=/dev/zero of=/home/swap-fs bs=1M count=512 512+0 records in 512+0 records out # ls -l /home/swap-fs -rw-r--r-- 1 root root 536870912 Jan 2 23:13 /home/swap-fs 2. mkswap으로 swap 영역 설정하기 # mkswap /home/swap-fs Setting up swapspace version 1, size = 536866 kB 3. swapon으로 swap enable 시키기 # swapon /home/swap-fs 4. /etc/fstab에 설정하기 /home/swap-fs swap swap defaults 0 0