rsync.sh

#!/bin/bash
file1=`du -sm /var/www/vhosts/|awk '{print $1}'`
ps=`ps -C rsync --no-header|wc -l`
if [ "$file" = "11517" ];then
echo "files downloaded!"
else
if [ "$ps" = "1" ];then
kill -9 $(ps aux | grep rsync |grep -v grep| awk '{print $2}')
sleep 1
nohup sh /root/rsync.sh &
else
echo "rsync is running..."
fi
fi

  

posted @ 2020-12-24 22:11  tigergaonotes  阅读(102)  评论(0编辑  收藏  举报