I would like to understand how does a script on a usb stick can lunch itself. I would like to make a script that is on my usb stick and when the usb is connected it lunch a code like this:
#!/usr/bin/env bash
if zenity --question --text="Do you wish to make a backup of your documents/?"; then
now=$(date)
cp /my/document/path/* /my/usb/stick/now
fi
The problem is that I don't understand how this .sh file that is on my usb drive know that the usb as been connected and have to lunch itself.
I hope I've explained well enough,
Thanks for your time.
Vincent