관리자메뉴 관리자 글쓰기

notice

category

전체 (348)
일상의 이야기 (138)
OS_Develop (56)
Culture (91)
Books (25)
관심사항 (16)
기타등등 (14)
PhotoBlog (7)
NAS (1)
springnote (0)
툴바 보기/감추기
삶의 이야기를 잊더라도 나중에 추억으로 기억하자

'bash'에 해당되는 글 1

  1. 2005/08/13| 혀노| 로그에 날짜 남기는 법

날짜 조합
< 연도>
%Y : 2005 Year with century as a four-digit decimal number [1970-2037]
%y : 05 Year without century as a two-digit decimal number [00-99]
< ?gt;
%m : Month as a decimal two-digit number [01-12]
<>
%d : Day of the month as a two-digit decimal number [01-31]

< 시간>
%H : Hour (24-hour clock) as a two-digit decimal number [00-23]
%I : Hour (12-hour clock) as a two-digit decimal number [01-12]
< ?gt;
%M : Minute as a decimal two-digit number [00-59]
<>
%S : Second as a two-digit decimal number

Script name : ping_chk.sh

#!/usr/bin/sh
DAY1=`date +%Y%m%d`
TIME1=`date +%H%M%S`

LOG=\logdir\ping_${DAY1}_{TIME1}.log

ping tivoli 56 5 >> ${LOG}

명령 수행 : sh ping_chk.sh &

ping tivoli 10 5
; tivoli server로 ping test를 수행함,
test 시 56byte(default 임)의 data을 전송하며, 5회 실시한다.
2005/08/13 00:27 2005/08/13 00:27