Skip to content

Instantly share code, notes, and snippets.

@rchampourlier
Created August 4, 2011 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rchampourlier/1124608 to your computer and use it in GitHub Desktop.
Save rchampourlier/1124608 to your computer and use it in GitHub Desktop.
Small launchd script for MacOS X to backup a Photo Booth library every 15 minutes
#!/bin/bash
# Simple script to backup a Photobooth Library hosted in a
# guest account to another folder.
# Intended to be scheduled regularly through launchd.
# Intended for French distribution in this state, needs
# localization to work on another language.
# Tested under Mac OS X Lion.
#
# Useful tutorial for launchd: http://www.devdaily.com/mac-os-x/mac-osx-startup-crontab-launchd-jobs
BACKUP_FOLDER="/Users/Shared/backuppb"
DATE_SUFFIX=`date "+%Y%m%d-%H%M%S"`
FILE_NAME="photobooth-backup"
FILE_PATH="$BACKUP_FOLDER/$FILE_NAME-$DATE_SUFFIX"
STOP_FILE="$BACKUP_FOLDER/remove-to-start-backup"
PICTURES_FOLDER="/Users/Guest/Pictures"
PHOTOBOOTH_FOLDER="$PICTURES_FOLDER/Biblioth*"
if [[ -e $STOP_FILE ]]; then
echo "$DATE_SUFFIX: Remove 'remove-to-start-backup' file to start backup"
else
echo "$DATE_SUFFIX: Backing up $PHOTOBOOTH_FOLDER to $FILE_PATH"
cp -R $PHOTOBOOTH_FOLDER $FILE_PATH
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment