백업 스크립트
/dev/sda -> /dev/sdb로 미러링 할 수있는 스크립트
미러링 후, /dev/sdb에 boot loader 만 설치 하면 끝 ~
=========================================================
#!/bin/bash
today=$(/bin/date +%y-%m-%d)
/bin/echo ” ” > /root/log/$today
/bin/echo “BACKUP start” >> /root/log/$today
/bin/date >> /root/log/$today
/bin/echo ” ” >> /root/log/$today
/bin/echo ” ” >> /root/log/$today
/bin/mount /dev/sdb2 /backup
/bin/mount /dev/sdb1 /backup/boot
/bin/mount /dev/sdb5 /backup/var
/bin/mount /dev/sdb6 /backup/home
/usr/bin/rsync -auz –delete / /backup/ –exclude backup –exclude dev –exclude proc –exclude sys –exclude tmp –exclude home
/usr/bin/rsync -auz –delete /home/ /backup/home/
/bin/df >> /root/log/$today
/bin/echo ” ” >> /root/log/$today
/bin/echo ” ” >> /root/log/$today
/bin/umount /backup/home
/bin/umount /backup/var
/bin/umount /backup/boot
/bin/umount /backup
/bin/echo “BACKUP end” >> /root/log/$today
/bin/date >> /root/log/$today
/bin/echo ” ” >> /root/log/$today
=========================================================