summaryrefslogtreecommitdiff
path: root/incremental-complete-backup/backup-tool.sh
diff options
context:
space:
mode:
authorsgk2015-04-24 12:50:15 +0530
committersgk2015-04-24 12:50:15 +0530
commitcf12032dd4e6077893c480b5330875a8d71a40ab (patch)
tree5f4324b993dab6cbca7221257be2d7e1b5ac3134 /incremental-complete-backup/backup-tool.sh
parentf1fa1975ae42221ecf01754904d35c1fa24bd834 (diff)
downloadFOSSEE-netbook-tools-cf12032dd4e6077893c480b5330875a8d71a40ab.tar.gz
FOSSEE-netbook-tools-cf12032dd4e6077893c480b5330875a8d71a40ab.tar.bz2
FOSSEE-netbook-tools-cf12032dd4e6077893c480b5330875a8d71a40ab.zip
Fix $device_name
fix tracking $device_name
Diffstat (limited to 'incremental-complete-backup/backup-tool.sh')
-rw-r--r--incremental-complete-backup/backup-tool.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/incremental-complete-backup/backup-tool.sh b/incremental-complete-backup/backup-tool.sh
index e86c5b2..70abeda 100644
--- a/incremental-complete-backup/backup-tool.sh
+++ b/incremental-complete-backup/backup-tool.sh
@@ -62,7 +62,7 @@ done
removeSDCARD() {
# The dialog box below will ask user to remove drive(sdcard)
zenity --question --title "Remove media" \
---text "Please remove your drive(sdcard) if connected,
+--text "Please remove your drive (sdcard/pendrive) if connected,
then press YES to continue"
# Checking the return value of zenity dialog, same as previous function
if [ $? -eq 1 ]
@@ -82,7 +82,7 @@ fi
# ------------------------------------------------------------#
insertSDCARD() {
# The dialog box below will ask user to insert sdcard
-zenity --question --title "Insert media" --text "Now please insert your drive(sdcard) back,\
+zenity --question --title "Insert media" --text "Now please insert your drive(sdcard/pendrive) back,\
then press YES to continue"
# Checking the button selected in zenity dialog
if [ $? -eq 1 ]
@@ -157,7 +157,16 @@ sudoAccess
removeSDCARD
insertSDCARD
SizeofSDCARD
-dev_name=`lsblk |head -2|tail -1|cut -d" " -f1` # tracking device name
+if [ `ls /dev/mmc*` != "" ] ;
+then # memory card detected
+ $dev_name=`ls /dev/mmc* |head -1`
+elif [ `ls /dev/sd*` != "" ];
+then # pendrive detected
+ $dev_name=`ls /dev/sd* |head -1`
+else
+ zenity --width=600 --height=100 --info --text "Device not found !"
+ exit
+fi
selection_menu "Select Backup mode" "Incremental Backup" "Complete Backup"
case "${result}" in
"1" ) # Incremental
@@ -193,6 +202,9 @@ case "${result}" in
"2" ) # Complete
formatforComplete
sudo rsync -latgrzpo /opt/fossee-os/* /mnt/boot/
+ rm -r ~/.ssh ~/.mozilla ~/.config/chromium
+ rm -r ~/Templates ~/Downloads/*
+ rm ~/.vimrc ~/.viminfo
rm -f /etc/udev/rules.d/70-persistent-net.rules
sudo tar -cpzf /mnt/boot/fossee-os.tar.gz --one-file-system /
sync