#!/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