]> git.openstreetmap.org Git - chef.git/commitdiff
Change the wiki dump cron job to something that might work
authorTom Hughes <tom@compton.nu>
Sun, 24 Feb 2019 19:39:10 +0000 (19:39 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 24 Feb 2019 19:44:29 +0000 (19:44 +0000)
cookbooks/wiki/recipes/default.rb
cookbooks/wiki/templates/default/cron_wiki_dump.erb [deleted file]
cookbooks/wiki/templates/default/wiki-dump.erb [new file with mode: 0644]

index 5e15212e0410c1010780c2627dab840442a5aecc..3e3815dcabf9e238322f319587f42c86d772268c 100644 (file)
@@ -23,8 +23,6 @@ include_recipe "mediawiki"
 
 passwords = data_bag_item("wiki", "passwords")
 
 
 passwords = data_bag_item("wiki", "passwords")
 
-dump_directory = "/srv/wiki.openstreetmap.org/dump"
-
 package "lua5.1" # newer versions do not work with Scribuntu!
 
 apache_site "default" do
 package "lua5.1" # newer versions do not work with Scribuntu!
 
 apache_site "default" do
@@ -117,16 +115,16 @@ cookbook_file "/srv/wiki.openstreetmap.org/favicon.ico" do
   mode 0o644
 end
 
   mode 0o644
 end
 
-directory dump_directory do
+directory "/srv/wiki.openstreetmap.org/dump" do
   owner node[:mediawiki][:user]
   group node[:mediawiki][:group]
   mode "0775"
 end
 
   owner node[:mediawiki][:user]
   group node[:mediawiki][:group]
   mode "0775"
 end
 
-template "/etc/cron.d/wiki-osm-org-dump" do
+template "/etc/cron.d/wiki-dump" do
   owner "root"
   group "root"
   mode 0o644
   owner "root"
   group "root"
   mode 0o644
-  source "cron_wiki_dump.erb"
-  variables :dumppath => dump_directory
+  source "wiki-dump.erb"
+  variables :directory => "/srv/wiki.openstreetmap.org"
 end
 end
diff --git a/cookbooks/wiki/templates/default/cron_wiki_dump.erb b/cookbooks/wiki/templates/default/cron_wiki_dump.erb
deleted file mode 100644 (file)
index 4ed8c8a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# DO NOT EDIT - This file is being maintained by Chef
-
-cd <%= @basepath %>/maintenance
-php dumpBackup.php --full > "<%= @dumppath %>/dump.xml"
diff --git a/cookbooks/wiki/templates/default/wiki-dump.erb b/cookbooks/wiki/templates/default/wiki-dump.erb
new file mode 100644 (file)
index 0000000..8139f28
--- /dev/null
@@ -0,0 +1,3 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+0 2 * * * wiki cd <%= @directory %> && php w/maintenance/dumpBackup.php --full --quiet --output=gzip:dump/dump.xml.gz