rsync backup urltv

From WebHostingNeeds.com
Jump to: navigation, search

Setup BQBackup as per

http://www.bqbackup.com/setup.html

mkdir /usr/hostonnet/
vi /usr/hostonnet/rsync_backup_daily.sh

Add

#!/bin/bash

rsync -avz -e ssh /home/mysql/ [email protected]:daily/mysql/
rsync -avz -e ssh /home/urltv_new/ [email protected]:daily/urltv_new/

echo 'daily backup finished on urltv' | mail -s "daily backup finished on urltv"  [email protected]


Create weekly and monthly files

sed -e "s/daily/weekly/g" /usr/hostonnet/rsync_backup_daily.sh > /usr/hostonnet/rsync_backup_weekly.sh
sed -e "s/daily/monthly/g" /usr/hostonnet/rsync_backup_daily.sh > /usr/hostonnet/rsync_backup_monthly.sh

Make it executable

chmod 755 /usr/hostonnet/rsync_backup_daily.sh
chmod 755 /usr/hostonnet/rsync_backup_weekly.sh
chmod 755 /usr/hostonnet/rsync_backup_monthly.sh

Add cronjob

0 1 * * * /usr/hostonnet/rsync_backup_daily.sh  2>&1>> /var/log/rsync_daily.log
0 8 * * 6 /usr/hostonnet/rsync_backup_weekly.sh 2>&1>> /var/log/rsync_weekly.log
0 16 1 * * /usr/hostonnet/rsync_backup_monthly.sh 2>&1>> /var/log/rsync_monthly.log



backup

rsync