@AugierLe42e I assume that port is fixed to a specific USB Hub / Controller / Port and the button is similarly linked to some GPIO / I²C / PS/2 port...
- What you can do is check
lsusb
for #USB devices and see if the specific port in question has a USB mass storage device or SATA bridge chip attached to it when said button is pressed.
If #QNAP used #Linux they should've provided those drivers / scripts as part of their #GPLv2 obligations to buyers/owners of said #NAS boxes.
- Just don't expect any of that code to be useable, as @landley can attest from the #BusyBox license enforcement…
Either way if you can reliably identify the port & detect the button presses that should be sufficient to build like a #bash or #python script to basically detect the drive, mount it and cp -r /dev/$DRIVE/ /home/copied_drives/$LABEL/
- It may need some fiddling and will most likely only work reliably on unencrypted drives with ext2-ext4, btrfs, ntfs, fat32, exfat filesystems...
Pretty shure you'll have to tweak a bit unless you want to use /dev/by-uuid/$UUID
and the UUIDs of the partitions as name...