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.ini
file. --> more information below - Execute the installation script with
sudo
:sudo sh install.sh lcd
orsudo sh install.sh auto
. Use theauto
installation if you aren't using an LCD screen to actively manage. Uselcd
if 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 -v
command and observed by thebcdUSB
descriptor. - Press the
select
button to start the backup. The backup source and the backup destination are determined in thesettings.ini
file. - Once everything is confirmed and mounted, select the
right
button to perform andrsync
differential 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 seconds
after theIt's safe to remove drives
dialog box appears. - If you wish to
restart
the Raspberry Pi, simply hit theup
button. This will restart the raspberry pi. A3 second
timer will appear notifying you a restart is pending. - If you wish to
shutdown
the Raspberry Pi, simply hit thedown
button. 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
right
button 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.py
and/ordumper_no_lcd.py
and change the source location for thesettings.ini
file.
Chris Herzog |
Joe Freimuth |