Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- ###########################################################
- # ABOUT
- ###########################################################
- # Phil Stokes -- 2016
- # applehelpwriter.com
- # sqwarq.com
- ###################################################
- # DESCRIPTION
- ###################################################
- # This script is for use with Carbon Copy Cloner.
- # It writes the date of the last successful backup to the destination disk.
- # This date can then be retrieved by a custom applescript[1] to check the last successful backupdate on the clone.
- # [1] go to https://sqwarq.com/disk-inspector or applehelpwriter.com and search for "Disk Inspector"
- #
- ###################################################
- # Variables
- ###################################################
- dest="$2"
- exitStatus="$3"
- writepath="$dest"/"lastLog.txt"
- dir="$dest"/"Users/Shared"
- ###################################################
- # COMMANDS
- ###################################################
- if [ "$1" = "/" ]; then
- src=$(osascript -e 'tell application "System Events" to name of startup disk')
- else
- src="$1"
- fi
- if [ "$exitStatus" = "0" ]; then
- if [ -d "$dir" ]; then
- writepath="$dir"/"lastLog.txt"
- fi
- printf "$(date '+%A, %d %B %Y at %H:%M:%S')\n" > "$writepath"
- printf "$src" >> "$writepath"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement