View Single Post
  #17  
Old 12-07-2005, 08:31 PM
pwharff pwharff is offline
Registered User
 
Join Date: Dec 2005
Posts: 13
Ok, I have finally written my post backup script:

Code:
#!/bin/bash

#
# This script is intended to notify the Admin of backup status using Shirt Pockets SuperDuper! Success or Failure.
#

# Where to keep our log file
logPath=/var/log/backup-disk-usage

# Where is SD's .scheduledJobProperties file
statusPath=/private/var/root/Library/Application\ Support/SuperDuper\!/Scheduled\ Copies/Smart\ Update\ Backup1\ from\ Server.sdsp/.scheduledJobProperties

# Formatting of our log file
echo "<---- Backup Status for `date` ---->" >> "$logPath"
echo " " >> "$logPath"
echo "Drive Backed-up: Backup1" >> "$logPath"

# Find out status of SD's last backup. Success of Failure.
grep -A 1 SDExitStatus "$statusPath" | sed 's/\<key\>//g' | sed 's/\<\/key\>//g' | sed 's/\<string\>//g' | sed 's/\<\/string\>//g' | awk '{ print $1 }' >> "$logPath"

echo " " >> "$logPath"

# Include disk capacity info
df -ht hfs >> "$logPath"

echo " " >> "$logPath"

sleep 2

# Remotely copy to Apache HT docs dir using stored ssh key
scp /var/log/backup-disk-usage pwharff@noahprecision.com:/Library/WebServer/Documents/logs
Now I need to know how to run this shell script immediately after my scheduled backup and since I don't have direct access to this server (as mentioned above, over 1000 miles away) and no remote desktop connection or VNC, just Terminal, how would I do this?
Reply With Quote