#!/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
时间: 2024-10-18 01:51:54