标签:shell
#!/bin/bash #by LC #DIR=/root DIR=/server/scripts YUANFILE=hins423437.tar.gz BAKFILE=hins423437_xtra_20.*.tar.gz LC (){ if [ `ls -l $DIR|grep "${BAKFILE}"|wc -l` -eq 1 ] then DUYUAN=`ls -l $DIR|grep "${YUANFILE}"|awk ‘{print $5}‘` DUBAK=`ls -l $DIR|grep "${BAKFILE}"|awk ‘{print $5}‘` if [ ${DUBAK} -gt ${DUYUAN} ] then echo "$(date +%F_%H-%M-%S)===wait===" &>>/server/logs/hyerp_bak.log #sleep 10 sleep 30 if [ `ls -l $DIR|grep "${BAKFILE}"|awk ‘{print $5}‘` -eq ${DUBAK} ] then /bin/sh /root/alirds.sh &>/server/logs/rds_bak.log echo "$(date +%F_%H-%M-%S)====ok====" &>>/server/logs/hyerp_bak.log return else echo "$(date +%F_%H-%M-%S)====No transfer====" &>>/server/logs/hyerp_bak.log #sleep 3 sleep 60 LC fi else echo "$(date +%F_%H-%M-%S)====No transfer is completed===" &>>/server/logs/hyerp_bak.log #sleep 3 sleep 60 LC fi else echo "$(date +%F_%H-%M-%S)===cant find===" &>>/server/logs/hyerp_bak.log sleep 300 LC fi } main (){ LC echo "$(date +%F_%H-%M-%S)====MAIN====" &>>/server/logs/hyerp_bak.log } main
本文出自 “10886311” 博客,请务必保留此出处http://10896311.blog.51cto.com/10886311/1720495
标签:shell
原文地址:http://10896311.blog.51cto.com/10886311/1720495