summaryrefslogtreecommitdiff
path: root/incremental-complete-backup
diff options
context:
space:
mode:
authorsyamgk2015-04-16 16:53:41 +0530
committersyamgk2015-04-16 16:53:41 +0530
commit5c3632ea672a86f851ad0b1eb6f39e2f13da242e (patch)
tree48e77d979309b67480785229ca7b08b756d12244 /incremental-complete-backup
parent654b41a7c211d444ad65f20d737ff09ba4a836c0 (diff)
downloadFOSSEE-netbook-patcher-5c3632ea672a86f851ad0b1eb6f39e2f13da242e.tar.gz
FOSSEE-netbook-patcher-5c3632ea672a86f851ad0b1eb6f39e2f13da242e.tar.bz2
FOSSEE-netbook-patcher-5c3632ea672a86f851ad0b1eb6f39e2f13da242e.zip
added formating functionality
Diffstat (limited to 'incremental-complete-backup')
-rw-r--r--incremental-complete-backup/backup-tool.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/incremental-complete-backup/backup-tool.sh b/incremental-complete-backup/backup-tool.sh
index 859334a..69a7f23 100644
--- a/incremental-complete-backup/backup-tool.sh
+++ b/incremental-complete-backup/backup-tool.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+:!/bin/bash
#***********************************************#
# Gui tool to create backups of FOSSEE laptop #
# to external storage media. #
@@ -135,6 +135,7 @@ sudoAccess
removeSDCARD
insertSDCARD
SizeofSDCARD
+dev_name=`lsblk |head -2|tail -1|cut -d" " -f1` # tracking device name
selection_menu "Select Backup mode" "Incremental Backup" "Complete Backup"
case "${result}" in
"1" ) #Incremental
@@ -144,23 +145,24 @@ case "${result}" in
rootfs_path=`mount | grep ext|cut -d" " -f3` # tracking the rootfs mount path
mac_id=`cat /sys/class/net/eth0/address` # macid of the machine
if [ "$rootfs_path" == "" ] || [ "$mac_id" -ne `cat $rootfs_path/opt/.Hw_addr.txt` ];
- then
+ then # (no rootfs) or ( macids not matching)
zenity --width=600 --height=100 --info --text "Your storage media doesnot contain matching backup from this machine"
+ exit
else
-# rsync -avzr / $rootfs_path
+ rsync -avzr / $rootfs_path
fi
;;
"2" ) #start new rsync
cat /sys/class/net/eth0/address > /opt/.Hw_addr.txt # storing mac_id b4 copy
umount /media/$USER/*
- echo $password
+ for each in $(seq 1 $(ls -1 /dev/$dev_name* |sesd 1d|wc -l));do parted -s /dev/$dev_name rm $each;done
echo "start inc Bkup"
;;
esac
;;
"2" ) #Complete
+ for each in $(seq 1 $(ls -1 /dev/$dev_name* |sesd 1d|wc -l));do parted -s /dev/$dev_name rm $each;done
echo "Do a complete Backup"
sudo tar -cpzf /media/student/<sdcard>/FirmwareInstall/ubuntu/ubuntu13.04.tar --one-file-system /
;;
esac
-