Mitesh Shah
12 years ago
2 changed files with 0 additions and 34 deletions
@ -1,11 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
while true |
|
||||
do |
|
||||
ping -c1 192.168.0.206 &> /dev/null |
|
||||
if [ $? == 0 ] |
|
||||
then |
|
||||
echo "[+] Server Becomes Alive ......" |
|
||||
rsync -avz --delete /var/www/ root@192.168.0.206:/var/www/ |
|
||||
exit 0; |
|
||||
fi |
|
||||
done |
|
@ -1,23 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
while true |
|
||||
do |
|
||||
# Monitor Files Changes For Create, Delete, Move, File Permissions |
|
||||
inotifywait --exclude .swp ~ -r -e create -e modify -e create -e delete -e move -e attrib --format %e:%f /var/www/ |
|
||||
|
|
||||
# Rsync When Files Changed |
|
||||
rsync -avz --delete /var/www/ root@192.168.0.206:/var/www/ |
|
||||
|
|
||||
# If Rsync Fails |
|
||||
if [ $? != 0 ] |
|
||||
then |
|
||||
|
|
||||
echo "[+] Checking Server Health Script Is Already Running Or Not ....." |
|
||||
ps ax | grep check-server-health.sh | grep -v grep |
|
||||
|
|
||||
if [ $? != 0 ] |
|
||||
then |
|
||||
echo "[+] Starting Check Server Health Script ....." |
|
||||
bash /root/bin/check-server-health.sh & |
|
||||
fi |
|
||||
fi |
|
||||
done |
|
Loading…
Reference in new issue