Skip to content

Instantly share code, notes, and snippets.

@prenagha
Last active February 4, 2018 15:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prenagha/8525710 to your computer and use it in GitHub Desktop.
Save prenagha/8525710 to your computer and use it in GitHub Desktop.
Applescript to monitor age of last arq backupand send alert to notification center and email if too oldHook it up to run via launchd daily
--
-- Applescript to monitor age of last arq backup
-- and send alert to notification center if too old
--
set arqF to (path to current user folder) & "Library:Arq:lastsV2.dat" as string
set latest to arqF as alias
set mod_date to modification date of (info for latest)
set file_age to round (((current date) - mod_date) / days)
log "most recent Arq backup " & file_age & " days old " & arqF
if file_age > 7 then
display notification "Most recent Arq backup is " & file_age & " days old" with title "Arq Backups Not Running!!" subtitle "Contact Admin" sound name "Basso"
delay 1
set cn to computer name of (system info)
tell application "Mail"
tell (make new outgoing message)
set subject to cn & " Arq Backup Fail"
set content to "Most recent " & cn & " Arq backup is " & file_age & " days old"
make new to recipient at end of to recipients with properties {address:"admin@example.com"}
send
end tell
end tell
end if
@prenagha
Copy link
Author

prenagha commented Mar 4, 2014

updated to check the new Arq 4 file, lastsV2.dat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment