Skip to content

Instantly share code, notes, and snippets.

@mqu
mqu / usb-auto-backup
Last active October 3, 2023 14:43
usb-auto-backup script - a script connected to UDEV daemon, running rsync backup when user insert USB drive.
TODO :
- manage user notification ; notify-send not really working ; current alternative either.
- display hostid used to customize usb backup script.
INSTALL
- copy usb-auto-backup script to /usr/local/bin,
- create an partition on an USB drive named "backup" ; get id (/dev/sddX) -> will be needed in udev.rules
- identity your drive information for UDEV-rules using : udevadm info -a -p $(udevadm info -q path -n /dev/sdXX)
- create an UDEV rule : /etc/udev/rules.d/99-usb-auto-backup.rules like this one :