linux-image-manager/scripts/image/backup.sh

31 lines
655 B
Bash
Raw Normal View History

2020-05-02 11:46:39 +02:00
#!/bin/bash
2020-05-03 20:58:23 +02:00
info "Backupscript for memory devices started"
echo
info "Actual mounted devices:"
echo
ls -lasi /dev/ | grep -E "sd|mm"
2020-05-02 11:46:39 +02:00
echo
while [ \! -b "$ifi" ]
do
2020-05-03 20:58:23 +02:00
info "Please select the correct device."
question "/dev/:"
2020-05-02 11:46:39 +02:00
read device
2020-05-03 20:58:23 +02:00
ifi="/dev/$device"
done
2020-05-02 11:46:39 +02:00
while [ "$path" == "" ]
do
echo "Bitte Backupimagepfad+Namen zu $(pwd) eingeben:"
read path
if [ "${path:0:1}" == "/" ]
then
ofi=$path.img
else
ofi=$(pwd)"/"$path.img
fi
done
2020-05-03 20:58:23 +02:00
info "Input file: $ifi"
info "Output file: $ofi"
question "Please confirm by pushing \"Enter\". To cancel use \"Ctrl + Alt + C\""
2020-05-02 11:46:39 +02:00
read bestaetigung
dd if=$ifi of=$ofi bs=1M status=progress