-------- Original Message --------
Subject: [newbie] getpix and sizetest
Date: Fri, 23 Aug 2002 20:13:52 -0400
From: Todd Slater <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Organization: Little, if any
To: newbie <[EMAIL PROTECTED]>


As John requested, I reworked the scripts to make it easier for you to set
up the variables for your system.

Just make them executable, "chmod u+x getpix.sh sizetest.sh"

getpix.sh: gets pictures from your camera, copies them to a directory
named according to the date, renames them according to exif date, and
opens gqview so you can see them.

#!/bin/bash

# REQUIRES JHEAD
# See below for URL
# Set up system variables
# Mountpoint for your camera
CAM="/mnt/fuji"
# The folder on your media where the pictures are
SRC="/mnt/fuji/dcim/100_fuji"
# The root directory where you store your images
ROOT="/home/todd/fuji"
# The target folder name where pictures will be copied to
# Just the name, the complete path will be filled in
# Default will be YYYY_MM_DD
TARGET=`date +%Y_%m_%d`

# That's all you *have* to set up

clear

# Mount camera
mount $CAM

# Create target directory
mkdir $ROOT/$TARGET

echo "Copying images . . ."

# Copy images
cp $SRC/*.jpg $ROOT/$TARGET &&
echo "Finished copying images."

# Umount camera
umount $CAM

echo "You can disconnect the camera now."

# For some reason my pix have the executable bit set
chmod -x $ROOT/$TARGET/*.jpg

# Rename images -- requires jhead
# Get jhead at http://www.sentex.net/~mwandel/jhead/
# jhead does other stuff you might want to add here, too
jhead -n%Y_%m_%d-%k_%M_%S $ROOT/$TARGET/*.jpg

echo "Images have been renamed."
echo "Images are in $ROOT/$TARGET"

# Let's look at them in gqview
gqview $ROOT/$TARGET &
exit

sizetest.sh: tests the size of directories you specify as arguments; if
size is greater than 650 MB, sends you an e-mail notification. If not,
sends you an email telling you there's nothing to do. You can comment that
part out, of course.

#!/bin/bash

# To use, specify minimum depth and your e-mail address
# Use directories you want to test as arguments. 
# To test ~/fuji and ~/canon do
# ./sizetest.sh ~/fuji ~/canon
# I add this to cron and run it once a day.

# Choose the minimum depth for `find` command.
# Set to 0 if you want to include the base directory
# Set to 1 if you only want to test subdirectories
DEPTH=1

# Your e-mail address
ADDY=todd

for directory in `find  $@ -type d -mindepth $DEPTH`
do
        sizem="du -m -s $directory"
if [ `$sizem | awk '{print $1}'` -gt 650 ]
then
                echo "$directory is burnable: current size is `$sizem |
awk '{print $1}'`" >> size.$$
fi
done
if [ -f size.$$ ]
then
        mail -s "You have some burning to do!" $ADDY < size.$$
rm size.$$
else
        echo "No directories in $@ are large enough to warrant burning to
CD." | mail -s "Nothing to burn today!" $ADDY
fi
exit

I have others I use to resize and generate contact sheets using
ImageMagick, but they need cleaning up.

Todd


-- 
Todd Slater
The current tune is los amigos invisibles - the new sound of the
venezuelan gozadera - ultrafunk
My schooling not only failed to teach me what it professed to be teaching,
but prevented me from being educated to an extent which infuriates me when
I think of all I might have learned at home by myself. (George Bernard
Shaw)


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to