Is it possible on Linux (Ubuntu in my case) to configure the system to run a bash script just before a USB key is unmounted?
I have a portable personal wiki on a pendrive, and every time I unmount it from my machine I would like its contents to be automatically backed up to Amazon S3.
Is anything like this possible? It doesn't matter if the script runs for every single unmounting as I can easily identify in the script whether the device being unmounted is the one I want to back up.
Thanks in advance for any advice.