backup

######new-da-135#######
00 21 * * 1,2,3,4,5,6 /bin/sh /backup_script/INDIA/192.227.75.135/135_backup_daily.sh
#21 19 * * 7 /bin/sh /weeklybackup/INDIA/192.227.112.135/135_backup_weekly.sh

[root@ws242 /]# cat /backup_script/INDIA/192.227.75.135/135_backup_daily.sh
#!/bin/bash
start=`date`
/bin/sh /backup_script/INDIA/192.227.75.135/etc.sh
/bin/sh /backup_script/INDIA/192.227.75.135/var.sh
/bin/sh /backup_script/INDIA/192.227.75.135/usr.sh
/bin/sh /backup_script/INDIA/192.227.75.135/home.sh
end=`date`
echo “Start time : ${start}
End time  :${end}” > /backup_script/INDIA/192.227.75.135/135_backup_daily.log
[root@ws242 /]# cat /backup_script/INDIA/192.227.75.135/etc.sh
#!/bin/sh
Date1=`date +%d-%m-%Y`
#T1=`date +%H-%M`
T1=`date`
rsync -avz –password-file=/backup_script/pass -u  root@192.227.75.135::etc/ /Backup/INDIA/192.227.75.135/DAILY/etc/ > /backup_script/INDIA/192.227.75.135/logs/etc.log  2>&1
T2=`date`
echo “START : ” $T1  >> /backup_script/INDIA/192.227.75.135/logs/etc.log
echo “END : ” $T2  >> /backup_script/INDIA/192.227.75.135/logs/etc.log
##############   Mail Alerts  ##################
grep “rsync error” /backup_script/INDIA/192.227.75.135/logs/etc.log
i=`echo $?`
if [ $i -eq 0 ]
then
echo “
Dear All,
Please note that backup of the script “135_da/etc.sh” is not proper.
Thanx  ” > /tmp/40mail
cat /tmp/40mail | mail -s “JBOSS Improper-Backup alert” backup@privatebrandhost.com
else
echo “
Dear All,
Please note that backup of the script “135_da/etc.sh” is proper.
Thanx  ” > /tmp/40mail
cat /tmp/40mail | mail -s “JBOSS Proper-Backup alert” backup@privatebrandhost.com
fi
——————————————————————
[root@ws242 /]# cat /weeklybackup/INDIA/192.227.112.109/109_backup_weekly.sh
#!/bin/bash
start=`date`
/bin/sh /weeklybackup/INDIA/192.227.112.109/etc.sh
/bin/sh /weeklybackup/INDIA/192.227.112.109/usr.sh
/bin/sh /weeklybackup/INDIA/192.227.112.109/var.sh
/bin/sh /weeklybackup/INDIA/192.227.112.109/home.sh
end=`date`
echo “Start time :${start}
End time  :${end}” > /weeklybackup/INDIA/192.227.112.109/109_backup_weekly.log
[root@ws242 /]# cat /weeklybackup/INDIA/192.227.112.109/etc.sh
#!/bin/sh
Date1=`date +%d-%m-%Y`
T1=`date +%H-%M`
rsync -avz –password-file=/backup_script/pass -u  root@192.227.112.109::etc/ /Backup/INDIA/192.227.112.109/DAILY/ > /weeklybackup/INDIA/192.227.112.109/logs/etc.log  2>&1
T2=`date +%H-%M`
echo “START : ” $T1  >> /backup_script/INDIA/192.227.112.109/logs/etc.log
echo “END : ” $T2  >> /backup_script/INDIA/192.227.112.109/logs/etc.log
##############   Mail Alerts  ##################
grep “rsync error” /backup_script/INDIA/192.227.112.109/logs/etc.log
i=`echo $?`
if [ $i -eq 0 ]
then
echo “
Dear All,
Please note that backup of the script “png-109/etc.sh” is not proper.
Thanx  ” > /tmp/arkinc
cat /tmp/arkinc | mail -s “JBOSS Improper-Backup alert” linux@drushti.in
else
echo “
Dear All,
Please note that backup of the script “png-109/etc.sh” is proper.
Thanx  ” > /tmp/arkinc
cat /tmp/arkinc | mail -s “JBOSS Proper-Backup alert” linux@drushti.in
fi
[root@ws242 /]# 

Leave a Comment

Your email address will not be published. Required fields are marked *

Open chat