Created
July 9, 2011 05:12
-
-
Save mxswd/1073343 to your computer and use it in GitHub Desktop.
Mac OS X Checking if Backups work
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
#!/usr/bin/ruby | |
# remember to: | |
# sudo gem install pony | |
require 'rubygems' | |
require 'pony' | |
# -k Sender com.apple.backupd-auto | |
# This option specifies what recorded the log. | |
# -k Time ge -48h | |
# This filters out anything before 48 hours ago. | |
result = `syslog -k Sender com.apple.backupd-auto -k Time ge -48h` | |
if result.length > 1 | |
Pony.mail(:to => "EMAIL_TO_SEND_TO", | |
:via => :smtp, | |
:via_options=> { | |
:address => 'smtp.gmail.com', | |
:port => '587', | |
:enable_starttls_auto => true, | |
:user_name => "EMAIL_TO_SEND_FROM", | |
:password => "EMAIL_PASSWORD", | |
:authentication => :plain, | |
:domain => 'gmail.com' | |
}, | |
:subject => 'Backup Failure', | |
:body => result) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment