Last active
April 16, 2021 14:23
-
-
Save TaylorJadin/81e2988b25925db2c775aeff193092bc to your computer and use it in GitHub Desktop.
piboy pi backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
output=$1 | |
sd="/dev/mmcblk0" | |
if [ -z "$output" ] | |
then | |
echo "No output path specified." | |
echo "Example: backup.sh /media/usb1/piboy.img.gz" | |
exit | |
fi | |
sudo dd bs=4M if=$sd status=progress | gzip > $output | |
# Restore Command https://www.raspberrypi.org/documentation/linux/filesystem/backup.md | |
# gunzip --stdout PiOS.img.gz | sudo dd bs=4M of=/dev/sdb status=progress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment