From: Tom Hughes Date: Sun, 24 Feb 2019 19:39:10 +0000 (+0000) Subject: Change the wiki dump cron job to something that might work X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/91725b47f86bc1f0d13a3e554d6acc0f06468463?hp=a1780627367305e7bd8987ad71fec090cda8743f Change the wiki dump cron job to something that might work --- diff --git a/cookbooks/wiki/recipes/default.rb b/cookbooks/wiki/recipes/default.rb index 5e15212e0..3e3815dca 100644 --- a/cookbooks/wiki/recipes/default.rb +++ b/cookbooks/wiki/recipes/default.rb @@ -23,8 +23,6 @@ include_recipe "mediawiki" 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 @@ -117,16 +115,16 @@ cookbook_file "/srv/wiki.openstreetmap.org/favicon.ico" do 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 -template "/etc/cron.d/wiki-osm-org-dump" do +template "/etc/cron.d/wiki-dump" do 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 diff --git a/cookbooks/wiki/templates/default/cron_wiki_dump.erb b/cookbooks/wiki/templates/default/cron_wiki_dump.erb deleted file mode 100644 index 4ed8c8a68..000000000 --- a/cookbooks/wiki/templates/default/cron_wiki_dump.erb +++ /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 index 000000000..8139f28ad --- /dev/null +++ b/cookbooks/wiki/templates/default/wiki-dump.erb @@ -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