Added draft for auto-usb-backup

This commit is contained in:
Kevin Veen-Birkenbach 2023-04-26 11:51:26 +02:00
parent cc4e32af87
commit 6a4439ba57
4 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,6 @@
# independent-auto-usb-backup
This tool role allows to make an automatic backup to an usb stick
## More information
- https://unix.stackexchange.com/questions/67464/how-to-get-uuid-for-a-usb-drive
- https://unix.stackexchange.com/questions/65891/how-to-execute-a-shellscript-when-i-plug-in-a-usb-device

View File

@ -0,0 +1,2 @@
dependencies:
- independent_user-administrator

View File

@ -0,0 +1 @@
ATTRS{idVendor}=="152d", ATTRS{idProduct}=="2329", RUN+="/tmp/test.sh"

View File

@ -0,0 +1,8 @@
#! /bin/sh
env >>/tmp/test.log
file "/sys${DEVPATH}" >>/tmp/test.log
if [ "${ACTION}" = add -a -d "/sys${DEVPATH}" ]; then
echo "add ${DEVPATH}" >>/tmp/test.log
fi