Skip to content

Instantly share code, notes, and snippets.

@r38y
Created March 1, 2013 20:04
Show Gist options
  • Save r38y/5067338 to your computer and use it in GitHub Desktop.
Save r38y/5067338 to your computer and use it in GitHub Desktop.
Recipe to wrap EY backups with a snitch.
# set backup interval
# cron_hour = if node[:backup_interval].to_s == '24'
# "1" # 0100 Pacific, per support's request
# # NB: Instances run in the Pacific (Los Angeles) timezone
# elsif node[:backup_interval]
# "*/#{node[:backup_interval]}"
# else
# "1"
# end
cron_hour = "*/6"
if ['db_master'].include?(node[:instance_role])
cron "mysql" do
minute '10'
hour cron_hour
day '*'
month '*'
weekday '*'
command 'm=`time ( /usr/local/ey_resin/bin/eybackup ) 2>&1 > /dev/null` && curl -d "m=$m" https://nosnch.in/CHANGEME &> /dev/null'
not_if { node[:backup_window].to_s == '0' }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment