I don’t need to know how to put my SD card in a Windows box and create an image. I’m more interested in creating a mechanism where the OS will automatically backup to either a USB stick, USB drive, or a network share.
I want to develop a script which will control this mechanism, allowing users to determine the schedule, backup destination, compression / encryption options etc.
I also want to discuss the best methodology for backing up the OS.
So far, I have been able to set up a CRON job to backup the entire SD card to a USB stick, and also to a network share on my Windows box. I haven’t tried restoring these yet (since I’ve been busy updating to Raspbian Wheezy), but I expect they would work fine. The backups were done with the following commands:
- Code: Select all
sudo dd bs=1M if=/dev/mmcblk0p2 of=/mnt/usb/RPI_Backup.img
I have tried piping the dd input file through gzip before writing it to the HDD, and although it compressed down from 7.9Gb to about 2Gb, it did increase the backup time from about 1 hour to 2 hours. Not sure if compression is a good idea in my case.
Now I have installed a 120Gb USB HDD on my RPi, and plan to leave that connected full-time. Eventually I’d like to shift the OS onto that to improve performance & capacity (but that’s a whole other thread!), so in the mean time, this will be for backing up the OS.
Personally I’m aiming for a schedule as follows:
A full image backup on a Sunday night.
Incremental backups on subsequent nights through the week.
So, lets kick off this discussion and try to come up with a comprehensive guide to backups.