#!/bin/csh -f ######## read_fz20 ### $Id: read_fz20,v 1.3 2005/05/18 17:09:58 toma Exp toma $ ### $Source: /home/cujo/toma/reality/arneberg/digicams/fz20/software/RCS/read_fz20,v $ ### Author: Thomas R. Arneberg, tom@arneberg.com ### Started: 5/15/2005 # USAGE: # (plug FZ20 into usb port of your Linux computer) # % cd directory_where_you_want_pictures # % read_fz20 # (that's it!) # # This is a very simple little script that I wrote to copy files from # my Panasonic FZ20 digital camera to my Linux computer. I was doing this # manually, then figured I might as well write a script to do it, and # thought someone else out there might also benefit from it. # # Before you can run this script the first time, you first have to # create the mount point and the file system table entry: # # % su root # % mkdir /mnt/usbdrive # % vi /etc/fstab # (add this line:) # /dev/sda1 /mnt/usbdrive vfat noauto,user,umask=0 0 0 # # (Note: you can use whatever word you want for "usbdrive"...I use that # generic term so that I can also mount usb thumb drives, etc.) # # - Tom Arneberg fz20@arneberg.com # http://arneberg.com/digicams/fz20 ### Mount the FZ20 as a usb drive: mount /mnt/usbdrive ### Set some variables: set pattern = /mnt/usbdrive/dcim/10?_pana/*.jpg set numfiles = `ls $pattern | wc -l` set starttime = `date '+ %D at %T'` ### Copy each file from camera to local directory: foreach file ( $pattern ) echo "Copying $file on `date '+ %D at %T'`..." cp -p $file . end ### Unmount the camera: umount /mnt/usbdrive set endtime = `date '+ %D at %T'` ### Rename the files to embed the date (m/dd) in the filename: set prog_rename = rename_files_with_dates echo "" echo "running program $prog_rename..." echo "" $prog_rename *.jpg echo "" ### Print some statistics: echo " $numfiles files to copy" echo " starttime = $starttime" echo " endtime = $endtime" echo "" echo " % ls | wc -l" ls | wc -l echo "" echo " DONE\!" echo ""