GithubHelp home page GithubHelp logo

schnipdip / dump Goto Github PK

View Code? Open in Web Editor NEW
7.0 5.0 1.0 23.14 MB

Auto back up images from a raspberry pi to a removable storage device automatically from an SD card.

License: GNU Affero General Public License v3.0

Python 88.44% Shell 11.56%
raspberry-pi raspberrypi adafruit lcd lcd16x2 backup backup-script sd-card rsync rsync-backup

dump's Introduction

Blue-dump-truck-svg.png

Dump

Auto back up images from a raspberry pi to a removable storage device automatically from an SD card.

Requirements

  1. Raspberry Pi 4 B+
  2. Adafruit 16x2 with buttons --> information
  3. SD Card Reader --> found with lsusb -v
  4. Removeable Hard Drive --> found with lsusb -v
  5. The /dev/disk/by-id of Card Reader for FStab if it doesn't have a UUID
  6. Python 3

Get Started

  1. Install the required python libraries pip3 install -r requirements.txt
  2. Modify the settings in the linux/settings.ini file. --> more information below
  3. Execute the installation script with sudo: sudo sh install.sh lcd or sudo sh install.sh auto. Use the auto installation if you aren't using an LCD screen to actively manage. Use lcd if you are using the 16x2 lcd screen.

How to Use Dump with the LCD

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.

  1. 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 the bcdUSB descriptor.
  2. Press the select button to start the backup. The backup source and the backup destination are determined in the settings.ini file.
  3. Once everything is confirmed and mounted, select the right button to perform and rsync differential backup based on timestamps.
  4. 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 the It's safe to remove drives dialog box appears.
  5. If you wish to restart the Raspberry Pi, simply hit the up button. This will restart the raspberry pi. A 3 second timer will appear notifying you a restart is pending.
  6. If you wish to shutdown the Raspberry Pi, simply hit the down button. This will shutoff the raspberry pi. It's now safe to unplug the power supply from the Raspberry Pi.
  7. 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.

Understanding the Settings.ini File

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.

Troubleshooting

  1. If you aren't pulling the git repo into /home/pi/ then you need to open the dumper_lcd.py and/or dumper_no_lcd.py and change the source location for the settings.ini file.

Contributors


Chris Herzog


Joe Freimuth

dump's People

Contributors

mend-bolt-for-github[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

j-freimuth

dump's Issues

decouple code

decouple backup code
decouple lcd display and button functions

Feature: Display battery life

Display battery life at the main menu or have a battery life menu option.

Warn user at main menu before any transfer is selected battery is too low to securely transfer data.

Feature: Add batter life

Display battery life at the main menu or have a battery life menu option.

Warn user at main menu before any transfer is selected battery is too low to securely transfer data.

Service File

Need to create a linux systemd service file to execute the LCD init python script.

Alternative Backup Solution to Rsync

Basically, rebuild functionality of Rsync, however the function will allow a percentage display on the backups files. This will allow for multicore copying. Differential backup will have to be supported to prevent duplicates - checksum.

Issue with checksum - cpu intensive

Major Benefit, more information can be displayed to the user.

UDEV Rules

Need to create two udev rules for the python script monitoring both USB 3.0 ports.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.