Auto back up images from a raspberry pi to a removable storage device automatically from an SD card.
- Raspberry Pi 4 B+
- Adafruit 16x2 with buttons --> information
- SD Card Reader --> found with lsusb -v
- Removeable Hard Drive --> found with lsusb -v
- The /dev/disk/by-id of Card Reader for FStab if it doesn't have a UUID
- Python 3
- Install the required python libraries
pip3 install -r requirements.txt - Modify the settings in the
linux/settings.inifile. --> more information below - Execute the installation script with
sudo:sudo sh install.sh lcdorsudo sh install.sh auto. Use theautoinstallation if you aren't using an LCD screen to actively manage. Uselcdif you are using the 16x2 lcd screen.
In order to properly use Dump as it was intended, use the LCD screen. While not required, it allows you to actively manage and control your backups. It's safer.
- Connect your USB Devices into the two USB 3.0 ports for optimal performance. Make sure your USB devices operate at USB 3.0. This can be verified by using the
lsusb -vcommand and observed by thebcdUSBdescriptor. - Press the
selectbutton to start the backup. The backup source and the backup destination are determined in thesettings.inifile. - Once everything is confirmed and mounted, select the
rightbutton to perform andrsyncdifferential backup based on timestamps. - When the backup is completed and the dialog box that says it's safe to remove the drives appears, remove the drives. If you wish to run the backup again, simply hit the select button once you are returned back to the main screen
5 secondsafter theIt's safe to remove drivesdialog box appears. - If you wish to
restartthe Raspberry Pi, simply hit theupbutton. This will restart the raspberry pi. A3 secondtimer will appear notifying you a restart is pending. - If you wish to
shutdownthe Raspberry Pi, simply hit thedownbutton. This will shutoff the raspberry pi. It's now safe to unplug the power supply from the Raspberry Pi. - For testing purposes, if the drives are already mounted and the mount directories exist, you can simply hit the
rightbutton to perform a differential backup.
The settings file is comprised of a single [settings] field. Under this field there contains several variables that control how the devices are to be mounted and how to locate the devices.
| Settings | Information |
|---|---|
| dumper_loc | This for the sh isntall.sh auto setting. The location of dumper_no_lcd.py |
| backup_device_name | Generic name of the backup device. Can be found using lsusb. Can either add the full name or a portion of the known name. Example, Sandisk |
| input_device_name | Generic name of the source device. Can be found using lsusb. Can either add the full name or a portion of the known name. Example, Lexar |
| dev_backup_loc | The /dev/ point for the backup device. Can be found using lsblk and some digging. Example, /dev/disk/by-uuid/BA5C-B93C |
| dev_input_loc | The /dev/ point for the source device. Can be found using lsblk and some digging. Example, /dev/disk/by-id/usb-Lexar_LRWM04U_201804030001-0\:0-part1 |
| mnt_backup_loc | The mount location of where the backup device from /dev/ will be mounted to. Default is /mnt/. A folder will be created called /mnt/backup to mound the backup device to. |
| mnt_input_loc | The mount location of where the source device from /dev/ will be mounted to. Default is /mnt/. A folder will be created called /mnt/source to mound the backup device to. |
- If you aren't pulling the git repo into
/home/pi/then you need to open thedumper_lcd.pyand/ordumper_no_lcd.pyand change the source location for thesettings.inifile.
Chris Herzog |
Joe Freimuth |
