I have 4 internal drives (a,b,c,d) that I would like to back up to external drives (a_bak, b_bak, c_bak, d_bak; respectively).
I've attempted this using udev rules, from HERE, but I can't seem to make it work. First of all, I have two external drives from the same manufacturer, so the prefixes are the same (as they are listed in the ATTR key). I did attempt the code from the link, modifying it so that it matches my system, but it didn't work.
Am I better off creating a cron job, with a script that tries to determine which drive is connected (using the UUID preferably) and rsynching to it? Is there a more elegant method with udev?
Thanks in advance for your help!
EDIT: I'm using Ubuntu desktop 18.04. I have no virtualization, and I don't need to backup the boot drive. The drives I'd like to backup are simply data drives. The drives I'm planning on using are external USB drives. Also, the fs type for each of the drives is ext4. Apologies for not mentioning this earlier.
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_UUID}=="298738C85FC70C68", RUN+="/bin/backupStorageA.sh"
Many thanks again in advance. – rhunt915 Mar 08 '20 at 15:22