I need some help with the problem of an automatic copy from drive A --> drive B.

I want to detect a drive on mount as A - 1st mounted drive is A, as source drive. Detect the 2nd mounted drive as B - destination drive.

As soon as both drives are mounted, I want to automatically create a new folder and copy the content of drive A to the new folder on drive B. (In my case drive A will be an SD card, and drive B will be a harddisk or a USB drive).

How can I automate this process, perhaps using something like rsync for the copying?