I’ve noticed when playing with the code that the camera backup script operates slightly differently from the card backup script.
In the card backup script, there’s an explicit function that is waiting for the storage device to be mounted:
# Wait for a USB storage device (e.g., a USB flash drive)
STORAGE=$(ls /dev/* | grep "$STORAGE_DEV" | cut -d"/" -f3)
while [ -z "${STORAGE}" ]
do
sleep 1
STORAGE=$(ls /dev/* | grep "$STORAGE_DEV" | cut -d"/" -f3)
done
# When the USB storage device is detected, mount it
mount /dev/"$STORAGE_DEV" "$STORAGE_MOUNT_POINT"
This is not present in the camera backup script, there’s just a directory change:
cd "$STORAGE_MOUNT_POINT"
Should this be changed:
- To ensure that the storage device is mounted
- To have the same sequence of operations
- To be able to have continuity on user feedback.