While I’m no expert in Debian (the OS found on the WD My Cloud) I assume you will have to “unmount” the USB drive by issuing the unmount or similar command: “umount /dev/device-node” (where device-node is the drive to unmount), via SSH. You can create a batch script to run a program like “plink.exe” (part of the Puddy programs to automate the process of connecting to the WD My Cloud via SSH and unmounting the drive. You can find more information on the unmount command at this link: http://www.linfo.org/umount.html. Of course you will need to know the USB drive path/name as the Debian OS sees it in order to unmount the drive properly.
The batch file would look something like the commands below. Note these are examples and will not work properly unless modified for one’s individual WD My Cloud setup and USB drive location. The IP address used is fictitious one would use the IP address for their WD My Cloud.