I have idea, but only idea.
What I want? Automatic update of config files OH in RPi when USB is plugging.
My idea:
Plug USB
RPi automatic read USB
When RPi find on USB key folder with name OPENHAB_UPDATE
a) automatic compress old config files in RPi to the file with name backup_DATE.zip and copy to selected folder
b) then copy files from USB key to config folder
You can BackUp the “Old” Files with the BackUp Tutorial and than sync the new files with rsync. When you don’t like to do this manually, you can write a BashScript for this Commands. If you want start the Script at Mounting the USB Stick, you can use UDEV … Read the MAN Page for UDEV
Thanks,.
I have BashScript,that works fine when I run manually but I have problem with UDEV, I dont know how to detect idVendor and idProduct of USB (I know lsusb) and thet write it to UDEV.