I have a Raspberry pi b with an SD card reader connected to one of the USB ports. I would like to automatically process files as soon as an SD is inserted. Is there a way to somehow register a program to execute when a new USB disk is detected?
I basically want to use the RPI as a smart SD reader, so the SD reader will be fixed on the one USB port. And I want IoT like behavior with no user interaction ( other than inserting the SD ).
I am trying to avoid an infinite loop checking when one of the /media/usb? directories become valid.
I am new at RPI and not a low lever Linux guy, so any direction will help. Thanks,