Ubuntu Linux (or OSX) folder structure and scripts for photographers / by Keith Hunniford

I'm a tech guy and a photographer, and as a long time Ubuntu Linux user I have over the years built some workflow scripts, and practices that make importing and organizing files a breeze.  There is no reason why these same scripts shouldn't work in OSX / Mac but not tested.

You'll need a small amount of linux experience here - even if just enough to create a script, make it executable, and put it somewhere in your path, but that's outside the scope of this video.  If you need help, jump over to the video on Youtube and use the Youtube comments to post questions.


Here are the scripts!  Remember,  on my machine,  I work with everything in Home/shoots and that is how these scripts are written.  You'll need to watch the video to get the context of these scripts!

cpexported

#! /bin/bash
source_root=~/shoots/
destination=~/Pictures/exports/
echo Copying to Exported
echo -----------------------------------------------------------------------------
find $source_root -name "*.jpg" -not -path "*noexport/*"  -exec cp -np {} $destination \;

kmkdir

#! /bin/bash
destination_root=~/shoots/
dir_date=$(date "+%Y_%m_%d")
if [ -z "$1" ];then
destination=$destination_root$dir_date
else
destination=$destination_root$dir_date-$1
fi
shoots-mkdir $destination

shoots-mkdir (called by kmkdir, cpmedia and cpcard)

#! /bin/bash
destination=$1
echo Creating $destination
echo -----------------------------------------------------------------------------
mkdir -p $destination
mkdir -p $destination/exported
mkdir -p $destination/exported/finals
mkdir -p $destination/exported/finals/watermarked-noexport
mkdir -p $destination/exported/discards-noexport

cd $destination
nautilus . &>/dev/null

cpmedia  

(assumes that your Linux ID is 1000.. ie that you are the first user created on the system.)  Change NEF to whatever extension is appropriate - this is for NIKON raw files.

#! /bin/bash
camera_source=/run/user/1000/gvfs/gphoto2:*
destination_root=~/shoots/
dir_date=$(date "+%Y_%m_%d")
if [ -z "$1" ];then
destination=$destination_root$dir_date/
else
destination=$destination_root$dir_date-$1/
fi
shoots-mkdir $destination 
echo Moving files from Camera 
find $camera_source -name "*.NEF" -exec mv {} $destination \;

 

cpcard

change "keith" to whatever your username is on the system.  Change NEF to something else if you aren't copying NIKON raw files.  

#! /bin/bash
camera_source=/media/keith/*
destination_root=~/shoots/
dir_date=$(date "+%Y_%m_%d")
if [ -z "$1" ];then
destination=$destination_root$dir_date/
else
destination=$destination_root$dir_date-$1/
fi
shoots-mkdir $destination
echo Moving files from Card
find $camera_source -name "*.NEF" -exec mv {} $destination \;

webresize

(needs to be in the path so it can be run from the direction that contains the images you want to create a web version of) It users the "convert" tool which you might have to install.

#!/bin/bash
filematch=./$1*.jpg[2500x]
convert  $filematch  -quality 85% web%03d.jpg