A little script to backup a sd card with a progressbar. Creates an image file with date and given name.
Please install the following packages:
- pv - for showing progress bar
- dd - for generating image file
- lsblk - grep filesize of inserted sd card
- gzip - for compressing image file
- Edit
CARDSLOTNAME
andOUTPUTPATH
inbackup_sd.sh
to your needs. - Copy file to
.local/bin/
- Run
backup_sd.sh
in your terminal - Script will ask for filename and writes the image file to desired
OUTPUTPATH
Restore can be done with the following command. Replace image.gz
with the file name of your image:
gzip -dc image.gz | sudo dd bs=4M of=/dev/$CARDSLOTNAME