monitor-fail.sh

#!/bin/bash
. ~/.bashrc

current_date=`date +%Y-%m-%d`
echo ${current_date}
basepath=$(cd `dirname $0`; pwd)
cd $basepath
FAIL_PATH=/home/work/daiyuanpei/monitor-fail
if [ "`ls -A ${FAIL_PATH}`" = "" ];
then
    echo "${FAIL_PATH} is empty"
else
    echo "${FAIL_PATH} is not empty"
    rm -f /home/work/daiyuanpei/monitor-fail/t_*
    echo "emptying folder done"
fi

# 3 19 * * * (cd /home/work/daiyuanpei; bash ./monitor-fail.sh > /home/work/daiyuanpei/ct-out/ct_monitor-fail.out 2>&1 &)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章