Skip to content

Instantly share code, notes, and snippets.

@rudivs
Created August 15, 2013 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudivs/6242712 to your computer and use it in GitHub Desktop.
Save rudivs/6242712 to your computer and use it in GitHub Desktop.
udev auto sync folder and usb thumb drive #fails
# /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"
#! /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