Last active
February 4, 2018 15:25
-
-
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
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
-- | |
-- 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:"[email protected]"} | |
send | |
end tell | |
end tell | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated to check the new Arq 4 file, lastsV2.dat