I am using a raspberry PI. I want to create a USB bridge, meaning I can transfer the files from one USB to another automatically.
My problem is finding the specific USB I want to take the files from, and the USB I want to send them to. I've looked at all sorts, from lsblk which outputs the directory of the USB really nicely, i.e. /media/pi/, but if I have two USB's in, I don't know which one is the source and which one is the target.
If the device names were static, this would be fine, but the plan here is to be able to plug any two USB's in, and the source will always transfer to the target.
Basically I want to label one of the physical USB ports as the IN, and the other as the OUT, and anything on the IN gets transferred to the OUT.
To do this I need to:
- Find the files on the device plugged into the IN port
- Find the device plugged into the out port
- Move the files from the in port to the out port.
If I can find a way to do this, I can automate it.