Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
There is less than 24 hours left to vote in the 2015 LinuxQuestions.org Members Choice Awards. Click here to go to the polls. Vote now and make sure your voice is heard!
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I haven't found any programs doing this (in Linux):
- when a camera is connected (and recognized) it
- creates a folder according to the images/computers date (and checks that one doesn't exist, else it makes a [date-x] folder, where x is a rising number)
- copies all images to this folder
- asks permission to delete the images (or not, should be possible to specify)
- informs about the actions taken/openes the downloaded images folder should also be possible to specify).
I can't see this could be anything hard to create, but will I need to make this script myself, or is it just that I can't find this kind of a program? It could certainly exist, as this is something ppl probably want.
Well, I know that each time I plug my memory card into my card reader on my Ubuntu Desktop it offers to copy all the images off of the memory card for me. I'm not sure on the name of the program that pops up with that one... I'm on a laptop at school now and it's quite difficult to get Linux working here so I am using Windows... ugh... if no one else posts the name of that program I will check it when I get home tonight and post it for you.
Gphotolib, once you've set it up initially, will do all of that in about 3 commands. If you've not gotten gphoto set up yet I got a little verbose when doing mine and posted it all here.
That said, here's a little script which doens't have a whole lot of error checking (you can do that yourself if it gets to be a hassle), but which will do what you want:
# Camera all plugged in and ready? Good!
if [[ ! -e "./Photos" ]]; then
if [[ -e "./Photos/$today/" ]]; then
echo "./Photos/$today/ exists!"
echo "checking to see if ./Photos/$today-$increment exists..."
while [ -e "./Photos/$today-$increment" ]; do
echo "./Photos/$today-$increment exists!"
echo "filename = $filename"
num_photos= `gphoto2 --num-files`
echo "Downloaded $num_photos pictures to $filename!"
echo "Would you like to remove them from the camera (Y/N)?"
if [[ $delete == "Y" ]]; then
echo "Successfully deleted all files."
Edit pathnames, echo's, etc as you like (naturally). As for the "opens the downloaded folder", I wasn't going to put that in there simply because not everyone has an application which will do that (I certainly don't). If you're running Gnome, you could stick a line like
nautilus --no-desktop $filename &
in there at the end, which I think would accomplish the task.
Thank's for the script, I actually already started (or almost finished) coding one myself. The only problems I have are:
- echoed out messages don't appear anywhere
- i'd like to use kde's widgets, like a confirming before deleting, but obviously need to do learn kde coding before this
- I cannot delete with gphoto2 for some reason, it just doesn't delete (even if it succesfully does this command)
- delete-all fails as there is a "theme.dat" on my camera, which is impossible to delete.
On digikam I can delete pictures, but not the theme.dat file
It seems as this is known (deleting the theme.dat file), I remember seeing an error report on this issue somewhere. I have an Ixus 700 and it seems as development for its drivers are also a bit behind currently, but digikam can delete "normal" files!
But thanks fot the script anyway. I'd really be interested in knowing what prog ubuntu uses (I use debian myself)
Yeah, the delete-all-files has a known issue (see my post after that one). You won't be able to use graphical buttons in a bash script; if you want that, just use gtkam (gphoto2's GUI) instead.
The echo'd messages will appear on the commandline, the same place from which you started the script...
[laura@cleopatra ~/work]$ ./camera.sh
checking to see if ./Photos/08312005-1 exists...
filename = ./Photos/08312005-5/
Downloaded 30 pictures to ./Photos/08312005-5/!
Would you like to remove them from the camera (Y/N)?
Successfully deleted all files.
That's slightly hacked-up, as I don't have my camera plugged in so all of the calls to gphoto2 are commented out and the number of photos is hard-coded, but the meat of the script is still running.
Edit: I see that I left all of the "checking to see if.." debug lines in there. They ought to have been commented out, too. D'oh.
Last edited by rose_bud4201; 08-31-2005 at 03:30 PM.
Ohhhh, I see what you mean. Honestly, I'd just use the GUI or run the script manually when you plug the camera in....it's made for running froma commandline, not for background tasks (the fact that you want to give it input means you'll have to run manually). I haven't the faintest idea where output like that goes, but I've a hunch that it's /dev/null. You won't be able to respond to a program like that, either, so you'd better hardcode the deletion of files to either on or off so it doesn't hang waiting for your response.