Tuesday, February 10, 2009

Make backup script date to date tar

Make backup script date to date tar

#! /bin/bash

echo Backup Started `date` >> /root/backuplog

mkdir /mnt/plutobackup/www/`date +%Y%m%d`

tar -cvzf /mnt/plutobackup/www/`date +%Y%m%d`/html.tar.gz /var/www/punehtml >> /root/backuplog

mkdir /mnt/plutobackup/sql/`date +%Y%m%d`

tar -cvzf /mnt/plutobackup/sql/`date +%Y%m%d`/sql.tar.gz /var/lib/mysql >> /root/backuplog

echo Backup Completed `date` >> /root/backuplog

 

Make backup script

#!/bin/bash

rsync -rv /var/www/punehtml /mnt/plutobackup/www   > backup.log

rsync -rv /var/lib/mysql /mnt/plutobackup/sql   > backup.log

 
 

0 comments:

Post a Comment