Tried a little project to aid in transferring control files from my home computer to my work shop computer. The outcome confuses me. What am I doing wrong?The home computer is running Fusion 360 under Windows.The shop computer runs Debian Wheezy with rtai for LinuxCNC. It has no network connection.Fusion 360 generates numerical control files onto a USB stick, I bring the stick to the shop for processing.I would like when I plug the stick into the shop computer that all NC files get synced to the LinuxCNC  working folder.I have made this udev rule/etc/udev/rules.d/80-LARS.rulesACTION==add,SUBSYSTEMS==usb,ATTRS{idVendor}==0951,ATTRS{manufacturer}==Kingston,RUN+=/home/la/synch.shsynch.sh#!/bin/shlogger startsyncsudo rsync -a /media/LARS_GREJOR/NGC/* /home/la/linuxcnc/nc_files/touch /home/la/now.donelogger donesyncI put a mark in syslog and then unplug and replug the USB stick.Why so many syslog entries from my script?And no files are copied. If I run synch.sh manually, the files get copied.I have NOPASSWD:ALL set for group sudo. Tried rsync with and without sudo.la@debianRT:~/linuxcnc/nc_files$logger  mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmla@debianRT:~/linuxcnc/nc_files$sudo tail -50 /var/log/syslogMar 20 21:46:14 debianRT kernel: [ 2646.615824] FAT-fs (sdb1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!Mar 20 21:47:51 debianRT la: mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmMar 20 21:48:07 debianRT kernel: [ 2759.410620] usb 1-6: USB disconnect, device number 4Mar 20 21:48:27 debianRT kernel: [ 2780.064015] usb 1-5: new high-speed USB device number 5 using ehci_hcdMar 20 21:48:27 debianRT kernel: [ 2780.198530] usb 1-5: New USB device found, idVendor=0951, idProduct=1603Mar 20 21:48:27 debianRT kernel: [ 2780.198534] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3Mar 20 21:48:27 debianRT kernel: [ 2780.198537] usb 1-5: Product: DataTraveler 2.0Mar 20 21:48:27 debianRT kernel: [ 2780.198539] usb 1-5: Manufacturer: KingstonMar 20 21:48:27 debianRT kernel: [ 2780.198541] usb 1-5: SerialNumber: 20070620000000005918801BMar 20 21:48:27 debianRT kernel: [ 2780.199267] scsi6 : usb-storage 1-5:1.0Mar 20 21:48:27 debianRT mtp-probe: checking bus 1, device 5: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5Mar 20 21:48:27 debianRT mtp-probe: bus: 1, device: 5 was not an MTP deviceMar 20 21:48:27 debianRT logger: startsyncMar 20 21:48:27 debianRT logger: donesyncMar 20 21:48:28 debianRT logger: startsyncMar 20 21:48:28 debianRT logger: donesyncMar 20 21:48:28 debianRT logger: startsyncMar 20 21:48:28 debianRT logger: donesyncMar 20 21:48:28 debianRT logger: startsyncMar 20 21:48:28 debianRT logger: donesyncMar 20 21:48:28 debianRT logger: startsyncMar 20 21:48:28 debianRT kernel: [ 2781.196803] scsi 6:0:0:0: Direct-Access     Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 2Mar 20 21:48:28 debianRT kernel: [ 2781.197395] sd 6:0:0:0: Attached scsi generic sg2 type 0Mar 20 21:48:28 debianRT kernel: [ 2781.200667] sd 6:0:0:0: [sdb] 7888896 512-byte logical blocks: (4.03 GB/3.76 GiB)Mar 20 21:48:28 debianRT kernel: [ 2781.201159] sd 6:0:0:0: [sdb] Write Protect is offMar 20 21:48:28 debianRT kernel: [ 2781.201163] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00Mar 20 21:48:28 debianRT kernel: [ 2781.201660] sd 6:0:0:0: [sdb] No Caching mode page presentMar 20 21:48:28 debianRT kernel: [ 2781.201664] sd 6:0:0:0: [sdb] Assuming drive cache: write throughMar 20 21:48:28 debianRT kernel: [ 2781.204289] sd 6:0:0:0: [sdb] No Caching mode page presentMar 20 21:48:28 debianRT kernel: [ 2781.204294] sd 6:0:0:0: [sdb] Assuming drive cache: write throughMar 20 21:48:28 debianRT kernel: [ 2781.322475]  sdb: sdb1Mar 20 21:48:28 debianRT kernel: [ 2781.324537] sd 6:0:0:0: [sdb] No Caching mode page presentMar 20 21:48:28 debianRT kernel: [ 2781.324541] sd 6:0:0:0: [sdb] Assuming drive cache: write throughMar 20 21:48:28 debianRT kernel: [ 2781.324544] sd 6:0:0:0: [sdb] Attached SCSI removable diskMar 20 21:48:28 debianRT logger: donesyncMar 20 21:48:28 debianRT logger: startsyncMar 20 21:48:29 debianRT logger: donesyncMar 20 21:48:29 debianRT logger: startsyncMar 20 21:48:29 debianRT logger: startsyncMar 20 21:48:29 debianRT logger: startsyncMar 20 21:48:29 debianRT logger: startsyncMar 20 21:48:29 debianRT logger: donesyncMar 20 21:48:29 debianRT logger: donesyncMar 20 21:48:29 debianRT logger: donesyncMar 20 21:48:29 debianRT logger: donesyncMar 20 21:48:29 debianRT logger: startsyncMar 20 21:48:29 debianRT logger: donesyncMar 20 21:48:29 debianRT logger: startsyncMar 20 21:48:29 debianRT logger: donesyncMar 20 21:48:29 debianRT kernel: [ 2782.085316] FAT-fs (sdb1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!la@debianRT:~/linuxcnc/nc_files$
How to rsync files when a USB stick is mounted
scripting;rsync;udev;usb drive