I'm interested in running an rsync script whenever any new volume is mounted on my Debian box. What are some potential triggers / strategies for listening for a new volume mount?
You can create a new rule to
/etc/udev/rules.d/. First read the file
/etc/udev/rules.d/README. In the new rule file, add something like
(I did not try the above line, try your own rules.)
Note that the script will be run as
root. You might want to use
su to change that.
ACTION=="add" would require
script.sh first to mount the volume.