Coswell Productions

Bash magic: Get the chronological Originals contents from an iPhoto library that will fit on a CD

mkdir ~/Desktop/PhotoOffload;
find . -path "*Originals*" -type d | sort | xargs du -sk |\
awk 'BEGIN {s=0}{ns=s+$1;if(ns > 680000){print "Total - " s > "/dev/stderr";exit;}else{print $0; s=ns;}}' |\
cut -f2 | while read dir; do
  t=$(echo "$dir" | sed 's#/Originals##');
  mkdir -p ~/Desktop/PhotoOffload/${t};
  rsync -vru $dir ~/Desktop/PhotoOffload/$t/;
done

See what else is here...