to keep up on my backups I want to run a specific rsync command when I insert a specific sata hard drive(s) into any or all of my hotswap bays. Would this be done using uuids somehow to keep track of the drives? whenever I search I find udev for usb drives, can this work here as well?
|
I use a simple udev rule for this. The backup drive is marked with a specific volume label (use tune2fs to set it). The udev rule starts a script:
(you can use ENV{ID_FS_UUID}="some-uuid" if you'd prefer not to use volume labels) The script just runs the rsync:
udev expects the RUN="" command to be short-lived, so the script runs the rsync in the background. This will work for any type of drive and/or interface - as long as udev gets notification that the drive has been added. |
||||
|
|