Backup script for Raspberry Pi based on 'dd'.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Backup script for Raspberry Pi

This script does an image backup of the Pi SD card using dd. It is not the most efficient method, but it creates a complete backup and it's easy to restore in case of complete card failure.


  • Clone this repo into the folder where you keep your housekeeping scripts.
  • Modify the DIR variable to point to your destination
  • Update services stop and start sections to reflect your installated services
  • Make executable. chmod +x
  • Update crontab to run each it each night.


Update /etc/crontab to run as root every night at 3am

01 3 * * * root /home/pi/scripts/

The backup took a little more than an hour on my first run (SD card to USB HDD).


This script started from which in turn started from


Merged in later comments from the original thread (the pv exists check) and added the backup.log