Skip to Content
Linux Multimedia Hacks
book

Linux Multimedia Hacks

by Kyle Rankin
November 2005
Beginner
330 pages
9h 44m
English
O'Reilly Media, Inc.
Content preview from Linux Multimedia Hacks

Automatically Synchronize Your Camera and Computer

With a custom hotplug script, you can automatically synchronize your computer and USB storage device camera just by plugging in the camera.

On a particular vacation where I brought both my laptop and my digital camera, I noticed I was offloading the day’s pictures onto my laptop each night. The manual process was to plug in the camera, mount it as a USB storage device, create a new directory for the images, copy the images to the new directory, and, finally, unmount the camera. With a few tweaks to hotplug and a little detective work, I was able to make the entire process hands free: I now plug in the camera, and it automatically synchronizes everything for me. In this hack I describe the tweaks to hotplug, along with tips for creating your own custom synchronization script.

Configure Hotplug

Hotplug is a program under Linux that manages hot-pluggable devices. For the most part it is a program you don’t have to think about—just plug in your USB mouse, for instance, and hotplug will make sure the applicable drivers are loaded. Hotplug is very powerful, however, in that it allows you to customize what to do when a certain device is plugged in. The first step to configuring hotplug is to plug in a camera and scan the system logs to make sure the camera is recognized. In the case of my camera, hotplug recognized that it was a USB storage device and made sure my usb-storage module was already loaded:

 Jan 19 15:46:27 clover kernel: hub.c: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CentOS Bible

CentOS Bible

Christopher Negus, Timothy Boronczyk
Microsoft® SQL Server 2012 Unleashed

Microsoft® SQL Server 2012 Unleashed

Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein

Publisher Resources

ISBN: 0596100760Errata Page