Skip to content

Instantly share code, notes, and snippets.

@TaylorJadin
Last active April 16, 2021 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TaylorJadin/81e2988b25925db2c775aeff193092bc to your computer and use it in GitHub Desktop.
Save TaylorJadin/81e2988b25925db2c775aeff193092bc to your computer and use it in GitHub Desktop.
piboy pi backup
#!/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