On a backup process the program has to copy tar.gz
file to a mounted USB flash drive. The program (nodeJS) uses API child_process.exec()
to run the shell script.
The function itself obtains the stdio
.
So, using a shell script, how can I check whether the USBFlashDrive is disconnected/unplugged?
The device usually appears as sd[a-z]1
- please note the regex in the string.