Tentei um pequeno projeto para ajudar na transferência de arquivos de controle do meu computador de casa para o computador da minha oficina. O resultado me confunde. O que estou fazendo errado?
O computador doméstico está executando o Fusion 360 no Windows. O computador da loja roda o Debian Wheezy com o rtai para o LinuxCNC. Não tem conexão de rede.
O Fusion 360 gera arquivos de controle numérico em um pendrive, trago o gravador para a loja para processamento. Eu gostaria que, quando eu conectasse o stick no computador da loja, todos os arquivos NC fossem sincronizados com a pasta de trabalho do LinuxCNC.
Eu fiz esta regra do udev /etc/udev/rules.d/80-LARS.rules
ACTION=="add",SUBSYSTEMS=="usb",ATTRS{idVendor}=="0951",ATTRS{manufacturer}=="Kingston",RUN+="/home/la/synch.sh"
synch.sh
#!/bin/sh
logger startsync
sudo rsync -a /media/LARS_GREJOR/NGC/* /home/la/linuxcnc/nc_files/
touch /home/la/now.done
logger donesync
Eu coloco uma marca no syslog e, em seguida, desconecto e reconecto o dispositivo USB. Por que tantas entradas syslog do meu script? E nenhum arquivo é copiado. Se eu executar o synch.sh manualmente, os arquivos serão copiados.
Eu tenho NOPASSWD: TUDO definido para o grupo sudo. Tentei rsync com e sem sudo.
la@debianRT:~/linuxcnc/nc_files$logger mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
la@debianRT:~/linuxcnc/nc_files$sudo tail -50 /var/log/syslog
Mar 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: mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Mar 20 21:48:07 debianRT kernel: [ 2759.410620] usb 1-6: USB disconnect, device number 4
Mar 20 21:48:27 debianRT kernel: [ 2780.064015] usb 1-5: new high-speed USB device number 5 using ehci_hcd
Mar 20 21:48:27 debianRT kernel: [ 2780.198530] usb 1-5: New USB device found, idVendor=0951, idProduct=1603
Mar 20 21:48:27 debianRT kernel: [ 2780.198534] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 20 21:48:27 debianRT kernel: [ 2780.198537] usb 1-5: Product: DataTraveler 2.0
Mar 20 21:48:27 debianRT kernel: [ 2780.198539] usb 1-5: Manufacturer: Kingston
Mar 20 21:48:27 debianRT kernel: [ 2780.198541] usb 1-5: SerialNumber: 20070620000000005918801B
Mar 20 21:48:27 debianRT kernel: [ 2780.199267] scsi6 : usb-storage 1-5:1.0
Mar 20 21:48:27 debianRT mtp-probe: checking bus 1, device 5: "/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5"
Mar 20 21:48:27 debianRT mtp-probe: bus: 1, device: 5 was not an MTP device
Mar 20 21:48:27 debianRT logger: startsync
Mar 20 21:48:27 debianRT logger: donesync
Mar 20 21:48:28 debianRT logger: startsync
Mar 20 21:48:28 debianRT logger: donesync
Mar 20 21:48:28 debianRT logger: startsync
Mar 20 21:48:28 debianRT logger: donesync
Mar 20 21:48:28 debianRT logger: startsync
Mar 20 21:48:28 debianRT logger: donesync
Mar 20 21:48:28 debianRT logger: startsync
Mar 20 21:48:28 debianRT kernel: [ 2781.196803] scsi 6:0:0:0: Direct-Access Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 2
Mar 20 21:48:28 debianRT kernel: [ 2781.197395] sd 6:0:0:0: Attached scsi generic sg2 type 0
Mar 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 off
Mar 20 21:48:28 debianRT kernel: [ 2781.201163] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00
Mar 20 21:48:28 debianRT kernel: [ 2781.201660] sd 6:0:0:0: [sdb] No Caching mode page present
Mar 20 21:48:28 debianRT kernel: [ 2781.201664] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Mar 20 21:48:28 debianRT kernel: [ 2781.204289] sd 6:0:0:0: [sdb] No Caching mode page present
Mar 20 21:48:28 debianRT kernel: [ 2781.204294] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Mar 20 21:48:28 debianRT kernel: [ 2781.322475] sdb: sdb1
Mar 20 21:48:28 debianRT kernel: [ 2781.324537] sd 6:0:0:0: [sdb] No Caching mode page present
Mar 20 21:48:28 debianRT kernel: [ 2781.324541] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Mar 20 21:48:28 debianRT kernel: [ 2781.324544] sd 6:0:0:0: [sdb] Attached SCSI removable disk
Mar 20 21:48:28 debianRT logger: donesync
Mar 20 21:48:28 debianRT logger: startsync
Mar 20 21:48:29 debianRT logger: donesync
Mar 20 21:48:29 debianRT logger: startsync
Mar 20 21:48:29 debianRT logger: startsync
Mar 20 21:48:29 debianRT logger: startsync
Mar 20 21:48:29 debianRT logger: startsync
Mar 20 21:48:29 debianRT logger: donesync
Mar 20 21:48:29 debianRT logger: donesync
Mar 20 21:48:29 debianRT logger: donesync
Mar 20 21:48:29 debianRT logger: donesync
Mar 20 21:48:29 debianRT logger: startsync
Mar 20 21:48:29 debianRT logger: donesync
Mar 20 21:48:29 debianRT logger: startsync
Mar 20 21:48:29 debianRT logger: donesync
Mar 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$