My timestamping/thumbnailing script

#!/bin/bash
while [ -n "$1" ]; do
  if [ -f $1 ]; then
    DATE=$(date +"%Y%m%d-%H%M%S" --reference="$1")
    EXT=$(echo "$1" | sed 's/.*\././')
    DEST="$DATE$EXT"
    echo $1
    cp $1 "$DEST"
    cp "$DEST" "thumb-$DEST"
    touch --reference="$1" "$DEST"
    if [ "$EXT" == ".jpg" ]; then
       convert -size 640x480 -resize 640x480 "$DEST" "thumb-$DEST"
       touch --reference="$1" "thumb-$DEST"
    fi
  fi
  shift
done

Must write

../../bin/process-media

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>