From 4bd323cb0df8e1436c5aa7878fe7ab2b97ec76b7 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 23 Jun 2013 20:22:29 +0100 Subject: [PATCH] Move blog backup script to the right cookbook --- cookbooks/blog/recipes/default.rb | 8 ++++++++ .../templates/default/backup.cron.erb | 2 +- cookbooks/foundation/recipes/default.rb | 8 -------- 3 files changed, 9 insertions(+), 9 deletions(-) rename cookbooks/{foundation => blog}/templates/default/backup.cron.erb (75%) diff --git a/cookbooks/blog/recipes/default.rb b/cookbooks/blog/recipes/default.rb index 3a363bc02..95997cd28 100644 --- a/cookbooks/blog/recipes/default.rb +++ b/cookbooks/blog/recipes/default.rb @@ -86,3 +86,11 @@ apache_site "opengeodata.org" do template "opengeodata.erb" directory "/srv/opengeodata.org" end + +template "/etc/cron.daily/blog-backup" do + source "backup.cron.erb" + owner "root" + group "root" + mode 0750 + variables :passwords => passwords +end diff --git a/cookbooks/foundation/templates/default/backup.cron.erb b/cookbooks/blog/templates/default/backup.cron.erb similarity index 75% rename from cookbooks/foundation/templates/default/backup.cron.erb rename to cookbooks/blog/templates/default/backup.cron.erb index 6ab8a63e2..b64c4f072 100644 --- a/cookbooks/foundation/templates/default/backup.cron.erb +++ b/cookbooks/blog/templates/default/backup.cron.erb @@ -7,7 +7,7 @@ D=$(date +%Y-%m-%d) B=osm-blog-$D.tar.gz mkdir $T/osm-blog-$D -mysqldump --user=osm-blog-user --password=<%= @passwords["osmf-blog-user"] %> --opt osm-blog > $T/osm-blog-$D/osm-blog.sql +mysqldump --user=osm-blog-user --password=<%= @passwords["osm-blog-user"] %> --opt osm-blog > $T/osm-blog-$D/osm-blog.sql ln -s /srv/blog.openstreetmap.org $T/osm-blog-$D/www export GZIP="--rsyncable -9" diff --git a/cookbooks/foundation/recipes/default.rb b/cookbooks/foundation/recipes/default.rb index 366f8a695..7b1fa1d05 100644 --- a/cookbooks/foundation/recipes/default.rb +++ b/cookbooks/foundation/recipes/default.rb @@ -48,11 +48,3 @@ wordpress_plugin "sitepress-multilingual-cms" do site "blog.osmfoundation.org" source "plugins/sitepress-multilingual-cms" end - -template "/etc/cron.daily/blog-backup" do - source "backup.cron.erb" - owner "root" - group "root" - mode 0750 - variables :passwords => passwords -end -- 2.39.5