#!/bin/sh # I'm executed on MacOSX when a new volume is conncted. BACKUP_ROOT=/Volumes/USB/rsnapshot/.sync if test -d ${BACKUP_ROOT} then if [ "`ls -dl --time-style='+%m' ${BACKUP_ROOT} | sed 's!^.* \([0-9]\{2\}\) /.*$!\1!'`" != "`date '+%m'`" ] then /where/bin/rsnapshot -v monthly fi /where/bin/rsnapshot -v sync fi