#! /bin/bash
#Nautilus script that copy only non RAW files from camera to Disk
#Images are placed in /Your_destination/Year/Month/Day path

#Set extension of your RAW file here will not be copied. All other files wil be copied
RAW="NEF"

#Set root destination repositorie of your Picures
DESTINATION_REP=~/Images

for image in $NAUTILUS_SCRIPT_SELECTED_URIS
  do
      IMAGE_NAME=${image##*/} #${image##*/} Extract file name from URI
      if [[ ${IMAGE_NAME#*.} != $RAW ]] # ${image#*.} extract extension from file name
      then
          DESTINATION=$DESTINATION_REP/$(date -r $IMAGE_NAME +%Y)/$(date -r $IMAGE_NAME +%m)/$(date -r $IMAGE_NAME +%d)
          mkdir -p $DESTINATION
          cp $IMAGE_NAME $DESTINATION
      fi
done