RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR
'check list'에 해당되는 글 1
참 조잡하다 = ㅂ=)a
그래도 유용하게 잘 돌아간다~

#!/bin/bash
# scripts by uzoogom

export LANG_ALL=ko_KR.eucKR
day=$(date +%Y-%m-%d)
backuplist=$(cd /backup/ && ls -d *)
list="$day"backup_check.txt

echo "$day backup status" > $list
echo " " >> $list
echo "Success list--------------------------------" >> $list

echo " " > bad.txt
echo "Fail list--------------------------------" >> bad.txt

for checkname in $backuplist
do
        check=$(find /backup/$checkname -type f -name "backupTime($day).txt" | wc -l )

        if [ $check == 1 ]
        then
                echo "$checkname backup is successfully Done!" >> $list
        else
                echo "$checkname backup is Fail. plz check your system." >> bad.txt
        fi

done
cat bad.txt >> $list
success=$(grep "successfully" $list | wc -l)
nonsuccess=$(grep "Fail" $list | wc -l)
sed "1a Success  :"$success"\nFailure:"$nonsuccess"" $list > last.txt
cat last.txt > $list
cat $list | mail -s ""$day" real server backup status" uzoogom@dunet.co.kr serverbin@dunet.co.kr
mv $list /root/SH/checklog
rm -f /root/backup/*.txt
우주곰:지구곰이 아닙니다.
지구곰이 아닙니다.
Categories (190)
Information (5)
About uzoogom (5)
My Advanced Linux (73)
Learning Linux (96)
OperatingSystem (5)
Databases (4)
Tips! (1)
OpenSource (1)
«   2018/07   »
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
29 30 31        
  1. 2012/12 (2)
  2. 2012/04 (3)
  3. 2012/03 (6)
  4. 2012/02 (6)
  5. 2012/01 (2)