Updated backup script

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-03 20:58:23 +02:00
parent 916f0db76e
commit 9fa71fc5c9

View File

@ -1,20 +1,17 @@
#!/bin/bash #!/bin/bash
echo "Backupscript fuer SD's" info "Backupscript for memory devices started"
echo "@author KevinFrantz" echo
echo "@since 2017-03-17" info "Actual mounted devices:"
echo echo
echo "Liste der aktuell gemounteten Geraete:" ls -lasi /dev/ | grep -E "sd|mm"
echo
ls -lasi /dev/ | grep "sd"
echo "(Die Liste zeigt nur Geraete an welche auf den Filter /dev/sd* passen)"
echo echo
while [ \! -b "$ifi" ] while [ \! -b "$ifi" ]
do do
echo "Bitte waehlen Sie die korrekte SD-Karte aus:" info "Please select the correct device."
echo "/dev/:" question "/dev/:"
read device read device
ifi="/dev/$device" ifi="/dev/$device"
done done
while [ "$path" == "" ] while [ "$path" == "" ]
do do
echo "Bitte Backupimagepfad+Namen zu $(pwd) eingeben:" echo "Bitte Backupimagepfad+Namen zu $(pwd) eingeben:"
@ -26,8 +23,8 @@ while [ "$path" == "" ]
ofi=$(pwd)"/"$path.img ofi=$(pwd)"/"$path.img
fi fi
done done
echo "Inputfile: $ifi" info "Input file: $ifi"
echo "Outputfile: $ofi" info "Output file: $ofi"
echo "Bestaetigen Sie mit der Enter-Taste. Zum Abbruch Ctrl + Alt + C druecken" question "Please confirm by pushing \"Enter\". To cancel use \"Ctrl + Alt + C\""
read bestaetigung read bestaetigung
dd if=$ifi of=$ofi bs=1M status=progress dd if=$ifi of=$ofi bs=1M status=progress