LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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.

Notices


Reply
  Search this Thread
Old 07-15-2003, 10:21 AM   #1
mohapi
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 208

Rep: Reputation: 30
photo upload script


I currently mount the camera [/dev/sda1], then /mnt/camera, then cp /whatever/flicks to /data3/PHOTOS and view them with gimp.

Here is a script I've been given to upload photos from my Olympus C-4000 to my RH 9 machine;
----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
It uses jhead to get the date/time of the
photo and rename it:

#!/bin/bash
# A script to copy photographs from a Fuji finepix camera mounted
# as a vfat volume via USB and linux SCSI emulation /dev/sda1
# with the user option.

MOUNT_POINT=/local/camera

# Get the single command line parameter which should a non-existent
directory
new_dir=$1

if [ -z $new_dir ]
then
echo "Usage: $0 new_directory_name";
exit -1;
fi

# Prevent overwriting of existing directories
if [ -f $new_dir -o -d $new_dir ]
then
printf "That directory exists already - please rename it or
choose a new name for this one\n";
exit -1 ;
fi

mounted=`grep ${MOUNT_POINT} /etc/mtab | wc -c`
if [ $mounted -gt 0 ]
then
umount ${MOUNT_POINT};
fi
mount ${MOUNT_POINT}
printf "Starting the copying now\n";
time cp -pr ${MOUNT_POINT}/dcim/100_fuji $new_dir
copy_count=`ls $new_dir | wc -l`;
printf "Copied $copy_count files to $new_dir\n";
printf "Renaming files\n";

jhead -ft -nf -c $new_dir/*.jpg;

# Clear up after the copying
umount ${MOUNT_POINT}
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
Do I change MOUNT_POINT to = /data3/PHOTOS as it is where I put photos on my system? Also, what do I name the script and where should I put it? Does it go in /bin? I've never written or used a script before today.
Thanks

 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wanted: Batch Email Script for Snapfish photo-uploads mpm Linux - Software 1 05-28-2006 11:48 PM
Recursive Upload Script Kenji Miyamoto Linux - General 1 09-01-2005 11:18 PM
Help me to find suitable photo album script Xa! Linux - Software 2 08-12-2004 02:23 AM
Upload script UmneyDurak Linux - Newbie 2 07-30-2004 02:52 PM
Upload Script....but not php vous Programming 1 02-04-2004 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration