리눅스 서버 부팅시각 확인 방법 1. last 로그 확인


> last reboot



리눅스 서버 부팅시각 확인 방법 2. dmesg 로그 업데이트 시각 확인


> ll /var/log/dmesg




이 외의 자세한 내용은 /var/log 밑에서 찾아보면...

현재 설정된 크론탭 조회


# crontab -l




크론탭 추가/수정


# crontab -e

(이후 화면에서 vi편집기에서 처럼 편집하면 된다.)


<설명>

1번필드 : 시간(분)

2번필드 : 시간(시간)

3번필드 : 일자

4번필드 : 월

5번필드 : 요일(0:일요일, 1:월요일, 2:화요일….)

6번필드 : 실행할 명령이나 스크립트


<예시>

00 02 * * * /usr/local/bin/test.sh >> /test.log

: 매일 02시에 /usr/local/bin/test.sh를 실행하고, 해당 로그를 /test.log에 저장한다.


00 02 * * 6 /usr/local/bin/test.sh

: 매주 토요일 02시에 /usr/local/bin/test.sh를 실행한다.



자바(JAVA) 형 변환(String과 Date)



String to Date


String from = "2013-04-08 10:10:10";

SimpleDateFormat transFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

Date to = transFormat.parse(from);




Date to String


Date from = new Date();

SimpleDateFormat transFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

String to = transFormat.format(from);