UmountMemoryCard.sh

#!/bin/bash

# add to /etc/sudoers
# USER_NAME ALL=NOPASSWD:/bin/umount /media/USER_NAME/usbdisk-sdb1

DEVICE=usbdisk-sdb1

# clean
rm /media/${USER}/${DEVICE}/dcim/100nikon/*.jpg
sync

# umount
sudo /bin/umount /media/${USER}/${DEVICE}