# GetPix 12/15/03 # (c) 2003 by Stephen A. Ness # Download digital pix *.JPG and movies *.MOV from Olympus C740UZ (as $SRCDIR). # Currently does not handle TIFF (*.TIF). DATE=`yymmdd` DEVNULL="nul:" SRCDIR="$NEXTDRIVE/dcim/100OLYMP" DESTDIR="c:/home/photo/san/20$YEAR/$DATE" INDEX="c:/home/photo/san/20$YEAR/index.html" # Update INDEX file manually while copying proceeds. $EDITOR $INDEX& # Create destination directory. if [ -d $DESTDIR ] then echo $DESTDIR exists && exit 1 else mkdir $DESTDIR fi # Copy files, renaming on the fly. cd $SRCDIR echo Files on camera: ls # Copy JPG files. JPG_FLAG=false NFILES=`ls *.JPG 2>$DEVNULL | wc -l` n=1 for i in *.JPG do if [ $NFILES -eq 0 ]; then break; fi JPG_FLAG=true if [ $n -lt 10 -a $NFILES -ge 10 ]; then n=0$n; fi if [ $n -lt 100 -a $NFILES -ge 100 ]; then n=0$n; fi echo Copying $i to p$n.jpg... cp -p $i $DESTDIR/p$n.jpg || exit 1 n=`expr $n + 1` done # Copy MOV files. MOV_FLAG=false NFILES=`ls *.MOV 2>$DEVNULL | wc -l` n=1 for i in *.MOV do if [ $NFILES -eq 0 ]; then break; fi MOV_FLAG=true echo Copying $i to m$n.mov... cp -p $i $DESTDIR/m$n.mov || exit 1 n=`expr $n + 1` done echo Files in $DESTDIR: ls $DESTDIR # Remove original files. echo -n 'Delete original files? ' read x if [ x$x = xy ] then if $JPG_FLAG; then rm *.JPG; fi if $MOV_FLAG; then rm *.MOV; fi fi # cd out of $SRCDIR, so the camera can be powered down. cd $DESTDIR echo Turn off the camera! # Done. echo To do: echo 1: Rotate portrait orientation pix. echo 2: Delete unwanted pix. echo 3: Renumber echo 4: GenIndex exit 0 # end of GetPix