#!/bin/bash

declare x=0
function check
{
for i in `ps -ef | grep rsync`
do
if [[  $i =~ "-vzrtP" ]]; then
x=1
fi
done
return $x
}
check
[[ $x -eq 0  ]]&&nohup rsync -vzrtP --exclude '*kb/' --exclude '*.m3u8' --exclude '*.jpg' -u  SvcCWRSYNC@45.61.238.215::small /home/www/media/videos/iphone/&