I whipped up a little Python script to take the photos off of my digital camera the other day. It looks for a directory in a photo library location named for the current date in ISO standard format (YYYY-MM-DD), except without the dashes, and copies the pictures off of the camera.
It is run by the Linux hotplug system; the kernel runs /sbin/hotplug when a USB device (such as my camera) is plugged in (but it could be a firewire, PCI, etc device). The /sbin/hotplug script looks at the data it recieves from the kernel via environment variables, and thinks to itself, oh, I'll run /etc/hotplug/usb.agent.
That script then looks for the vendor and product ID of the device (among other flags) in /lib/modules/XXX/modules.usbmap and /etc/hotplug/usb.distmap, which are indexes of all the devices that the various modules that the currently running kernel knows about. Sometimes new devices will work with older modules, and it is necessary to add information manually, so it will also check for the device in /etc/hotplug/usb.handmap. If the information is found in any of these locations, the named driver is loaded into the kernel if it is not already.
It's pretty handy to be able to run scripts when devices are detected... such as copying all the photos off of the digital camera. That's where the /etc/hotplug/usb/*.usermap files. They map USB vendor and product IDs to names of scripts to run. All such scripts have to live in /etc/hotplug/usb. They should be owned by root and should not be writable by people other than root. This is because they are run as root, and thus pose a certian security risk.
So now my script. It's written in Python, as I mentioned, and it uses gPhoto2 to actually talk to the camera. It's lacking somewhat in error detection, if it is run without the camera actually being connected for instance, and it doesn't check for duplicates or anything, but it works. It writes a little log file about its conversation with the camera to /var/log/photo_import.
You can get it from this link right here. I hate it when people make links like that. Oh well.
A nice thing I've notice about this method over importing photos into iPhoto is that it doesn't put the camera in view mode. It just starts downloading, and keeps on downloading until it is finished. iPhoto leaves the camera in view mode, and if there are a large batch of files to be downloaded, the camera tends to shut off half way through. The only way to keep it from turning off seems to be to flip through photos occasionally as the download occurs. Maybe that's just a perculiarity of my camera though.