Created
August 15, 2013 17:21
-
-
Save rudivs/6242712 to your computer and use it in GitHub Desktop.
udev auto sync folder and usb thumb drive #fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/udev/rules.d/rvs-jt127.rules | |
ENV{ID_FS_LABEL_ENC}=="?*",ACTION=="add", SUBSYSTEMS=="usb", \ | |
ATTRS{idVendor}=="18a5", ATTRS{idProduct}=="0304", \ | |
RUN+="/home/rudi/james/system/usb_sync.sh %k" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# /home/rudi/james/system/usb_sync.sh | |
# Wait for Ubuntu to auto-mount the drive. | |
while [ ! -d /media/rudi/RVS-J127 ]; do | |
sleep 2 | |
done | |
# Sync Work folder. | |
echo "/usr/bin/rsync -au --delete /home/rudi/james/ /media/rudi/RVS-J127/" | /usr/bin/at now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment