We implemented a new feature for our PASSDORA Box. Passdora is a Raspberry Pi based system which hosts the Sequry password-manager.
New Features
What feature(s) did you add?
Automatically created backups should be copied to a connected USB-drive.
In order to access the USB-drive and copy the backup-files onto it, it needs to be mounted first.
Since the process should be automated, requiring no user interaction besides plugging in the USB-drive, a background script is required that automatically mounts USB-drives when they're connected.
Reasons
- copy backups to USB-drive -> mounting required
How did you implement it/them?
The following procedure should allow the automatic mount of USB-drives:
- create a udev-rule that detects when a (usb-)drives is plugged in (Build_Image/files/usb_automount/usbstick.rules)
- create a service that get's called by the udev-rule and starts a script to mount the connected drive (Build_Image/files/usb_automount/usbstick-handler@.service)
- create a script that finally mounts the drive (Build_Image/files/usb_automount/automount)
- add a step to the setup (-script) that copies the above files to their correct locations (Build_Image/scripts/system.sh)
Thanks for reading
Jan, for PCSG Developers
Posted on Utopian.io - Rewarding Open Source Contributors