#!/bin/bash

files[1]="/etc/rc.local"
files[2]="/etc/rsyncd.conf"
files[3]="/etc/xinetd.d/rsync"

element_count=${#files[@]}

index=0

while [ "$index" -lt "$element_count" ]
do
    let "index = $index + 1"
    if [ -f "${files[index]}" ]; then
        size=`ls -nl ${files[index]} | awk ' {print $5 }'`
        if [ $size = "0" ] ; then
            echo "${files[index]}" is broken
        fi

    else
        echo "${files[index]}" is broken
    fi

done

 

 

참고하세용

'unix and linux' 카테고리의 다른 글

grep -c 와 wc -l은 똑같은 명령어이다.  (0) 2007.10.18
crond 문제  (0) 2007.10.17
DNS 서버 보기  (0) 2007.10.10
crontab 이야기  (0) 2007.10.10
bash shell script substitution  (0) 2007.10.09
Posted by '김용환'
,