Small launchd script for MacOS X to backup a Photo Booth library every 15 minutes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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