#!/bin/bash -e HOST=hendry.iki.fi STATIC=/home/hendry/media/static STATICPATH=/home/hendry/static.natalian.org if [ $1 ]; then UP=$1 else UP=$STATIC/$(date --iso-8601)/ fi # in order for rsync to create the dir on the remote host # we must remove the trailing slash UP=$(echo $UP | sed 's/\/$//') echo rsync -essh -rtpvP $UP $HOST:$STATICPATH/ rsync -essh -rtpvP $UP $HOST:$STATICPATH/ # TODO: do not run if $1 is not an image # Write a seperate upload script # ssh $HOST /home/hendry/projects/static/flickr.sh