--------------------------------------
!# /bin/bash
clear
sudo mount /dev/sda1 /mnt/sda1
while [ 1 ]
do
clear
echo "-------------Back Up And Restore--------------"
echo "--------------Design for Linux----------------"
echo ""
echo "1.Back Up your system"
echo "2.Restore Your system"
echo "3.FileList"
echo "4.Quit"
echo "----------------------------------------------"
echo "Enter Your Choice:[1.2.3.4]"
read flag
case $flag in
1)
echo "Now back up Your System..."
tar -cvf /media/disk/linux_backup_etc.tar /etc
tar -cvf /media/disk/linux_backup_var.tar /var
tar -cvf /media/disk/linux_backup_home.tar /home
tar -cvf /media/disk/linux_backup_opt.tar /opt
echo "Done"
break
;;
2)
echo "Now Restore Your System..."
tar -xvf /media/disk/linux_backup_etc.tar -C /
tar -xvf /media/disk/linux_backup_var.tar -C /
tar -xvf /media/disk/linux_backup_home.tar -C /
tar -xvf /media/disk/linux_backup_opt.tar -C /
echo "Done"
break
;;
3)
echo "/etc"
echo "/var"
echo "/home"
echo "/opt"
break
;;
4)
break
;;

esac
done