Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Add eybackup_verbose cookbook

    - This cookbook removes the eybackup and ey-snapshots crontab from
      the 'root' user on 'solo' and 'db_master' instances, and replaces
      it with the same crontab however we >> to /db/eybackup.log and
      /db/ey-snapshots.log so any output from said cron jobs would be
      output there (and quiet mode is turned off)

Signed-off-by: Scott M. Likens <slikens@engineyard.com>
  • Loading branch information...
commit 08219e37a31e87d5153c9d8a0b948a2ca9713b80 1 parent 6adf649
Scott M. Likens authored
View
15 cookbooks/eybackup_verbose/README.rdoc
@@ -0,0 +1,15 @@
+= DESCRIPTION:
+
+This Cookbook/recipe will delete the eybackup and ey-snapshots crontab on 'solo' and 'db_master' instances, and then replace them with the same basic crontab except we append the output from said cronjobs to /db/eybackup.log and /db/ey-snapshots.log
+
+= WARNING:
+
+This Cookbook should be relatively safe and harmless; however if you move eybackup off to the db_slave, or have customized your Cloud Enviroment heavily it may not work as is.
+
+= USAGE:
+
+Uncomment require_recipe "eybackup_verbose" in main/recipes/default.rb
+
+= CREDITS:
+
+Engine Yard
View
43 cookbooks/eybackup_verbose/recipes/default.rb
@@ -0,0 +1,43 @@
+# Copyright Engine Yard - 2010
+
+#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
+
+
+if ['solo', 'db_master'].include?(node[:instance_role])
+ cron "eybackup" do
+ action :delete
+ end
+
+ cron "eybackup" do
+ minute '10'
+ hour cron_hour
+ day '*'
+ month '*'
+ weekday '*'
+ command "/usr/local/ey_resin/bin/eybackup >> /db/eybackup.log"
+ not_if { node[:backup_window].to_s == '0' }
+ end
+
+ cron "ey-snapshots" do
+ action :delete
+ end
+
+
+ cron "ey-snapshots" do
+ minute '0'
+ hour cron_hour
+ day '*'
+ month '*'
+ weekday '*'
+ command "ey-snapshots --snapshot >> /db/ey-snapshots.log"
+ not_if { node[:backup_window].to_s == '0' }
+ end
+end
View
3  cookbooks/main/recipes/default.rb
@@ -53,3 +53,6 @@
#uncomment to include the emacs recipe
#require_recipe "emacs"
+
+#uncomment to include the eybackup_verbose recipe
+#require_recipe "eybackup_verbose"
Please sign in to comment.
Something went wrong with that request. Please try again.