Shirt Pocket Discussions

Shirt Pocket Discussions (https://www.shirt-pocket.com/forums/index.php)
-   General (https://www.shirt-pocket.com/forums/forumdisplay.php?f=6)
-   -   Backup on mount notification that daily backup not made (https://www.shirt-pocket.com/forums/showthread.php?t=6545)

cookieme 10-15-2011 06:17 AM

Backup on mount notification that daily backup not made
 
I'm trying to think of an easy way to check whether a user has done their daily SD backup and if they haven't some how remind them.

As the backup only happens when the drive is connected it can happen anytime during the day. One idea I have is to write an AppleScript that looks at the SD logs and IF a backup was made any time during the current day the AppleScript would add an all-day event to an iCal calendar called SD Backup. This way the user can easily look in their calendar and see if they've forgotten to backup.

Any suggestions or better solutions to this?

Thanks

dnanian 10-15-2011 07:31 AM

You could also probably use Growl to do some sort of notification to run an application, and use that application to "turn off" a reminder that you'd do otherwise. (I don't know if Growl has a "run this script" action, but it probably does.)

You could do a similar thing with an "On successful completion" shell script.

cookieme 10-15-2011 02:23 PM

I can't find an option to run a shell script in the "On successful completion" drop down. Did you mean "Run shell script after copy completes" on the advanced tab?

If you meant the latter this would have to be a shell script that runs an applescript to add the event to ical or can I specify an applescript directly?

dnanian 10-15-2011 06:25 PM

Yes, sorry. It would have to be a shell script that runs an applescript (with, say, osascript).

cookieme 10-16-2011 06:35 AM

No worries. Thanks for your help.

I created the following little script:

Quote:

#!/bin/sh
#
# Shell script creates an iCal event using AppleScript.
#
osascript <<EOF
tell application "iCal"
tell calendar "SD Backup"
set theDate to current date
set theTime to time string of theDate
make new event at end with properties {summary:"SD Daily", start date:theDate, allday event:true, description:"Completed at " & theTime}
end tell
end tell
EOF


All times are GMT -4. The time now is 06:53 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.