diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-11-05 23:18:54 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-11-05 23:18:54 +0100 |
commit | c25c490677bcba2c2e9fee90db10594bd43f6982 (patch) | |
tree | 23bde01f60bf0e4421f680bcd9912b5a12f5b42d /ansible/roles/mediawiki/files/bin | |
parent | b5b7e21c8ba3c68eab9cd244602f27c21aa5f36b (diff) | |
download | infra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.gz infra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.bz2 infra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.xz infra-c25c490677bcba2c2e9fee90db10594bd43f6982.zip |
Importing Bitraf's mediawiki
o Some improvements, reusing old backup scripts.
Diffstat (limited to 'ansible/roles/mediawiki/files/bin')
-rw-r--r-- | ansible/roles/mediawiki/files/bin/mw-dump-backup | 9 | ||||
-rw-r--r-- | ansible/roles/mediawiki/files/bin/mw-dump-db | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/ansible/roles/mediawiki/files/bin/mw-dump-backup b/ansible/roles/mediawiki/files/bin/mw-dump-backup new file mode 100644 index 0000000..eb98d7d --- /dev/null +++ b/ansible/roles/mediawiki/files/bin/mw-dump-backup @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euo pipefail + +exec sudo -u www-data php /usr/share/mediawiki/maintenance/dumpBackup.php \ + --full \ + --include-files \ + --uploads \ + > /opt/mediawiki/backup/content-dump.xml diff --git a/ansible/roles/mediawiki/files/bin/mw-dump-db b/ansible/roles/mediawiki/files/bin/mw-dump-db new file mode 100644 index 0000000..5a6699a --- /dev/null +++ b/ansible/roles/mediawiki/files/bin/mw-dump-db @@ -0,0 +1,12 @@ +#!/bin/bash + +set -euo pipefail + +export PGHOST=$(sed -n 's,^.wgDBserver.*"\([^"]*\)".*,\1,p' /etc/mediawiki/LocalSettings.php) +export PGUDATABASE=$(sed -n 's,^.wgDBname.*"\([^"]*\)".*,\1,p' /etc/mediawiki/LocalSettings.php) +export PGUSER=$(sed -n 's,^.wgDBuser.*"\([^"]*\)".*,\1,p' /etc/mediawiki/LocalSettings.php) +export PGPASSWORD=$(sed -n 's,^.wgDBpassword.*"\([^"]*\)".*,\1,p' /etc/mediawiki/LocalSettings.php) +export PGPORT=$(sed -n 's,^.wgDBport.*"\([^"]*\)".*,\1,p' /etc/mediawiki/LocalSettings.php) + +rm -rf /opt/mediawiki/backup/db +exec pg_dump -b --format directory -f /opt/mediawiki/backup/db |