mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-25 14:11:03 +01:00
Added draft for auto-usb-backup
This commit is contained in:
parent
24e0e3be6d
commit
0d78516795
6
roles/independent-auto-usb-backup/README.md
Normal file
6
roles/independent-auto-usb-backup/README.md
Normal 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
|
2
roles/independent-auto-usb-backup/meta/main.yml
Normal file
2
roles/independent-auto-usb-backup/meta/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- independent_user-administrator
|
@ -0,0 +1 @@
|
||||
ATTRS{idVendor}=="152d", ATTRS{idProduct}=="2329", RUN+="/tmp/test.sh"
|
@ -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
|
Loading…
Reference in New Issue
Block a user