I would like to execute a backup script with rsync everytime a specific hard drive is plugged to my computer on ubuntu 16.04. However I would like the user to be prompted if the backup should run or not and then he should be able to see the rsync output live in a terminal.
What I did so far:
I created a rule at /etc/udev/rules.d/backup_on_mount.rules
ACTION=="add", ATTRS{idVendor}=="1058", ATTRS{idProduct}=="0820", RUN+="/path/to/my/script/backup_on_mount.sh"
I created the backup_on_mount.sh script and made it executable
However I did not succeed in popping a new terminal window with my script running in it when I plug my hard drive.
Does anybody have an idea on how to begin ?
Thank you