This is carried out with two shell scripts: One responsible for gathering the wiki contents in various formats as single files, and one responsible for uploading to a git repository.
The directory structure of the wiki installation is
w
├── api.php
├── autoload.php
├── backupper
├── ...
├── LocalSettings.php
├── ...
└── vendor
And the one of the backupper is like
backupper
├── assets
│ ├── database.sql
│ ├── full-dump.xml
│ └── wikidata.tar.gz
├── assets-git
│ ├── database.sql
│ ├── full-dump.xml
│ ├── README.md
│ └── wikidata.tar.gz
├── backup-private.sh
├── git-backup.sh
└── README.txt
The directory assets
is filled by backup-private.sh
and
assets-git
is the work place for git-backup.sh
. Both are rather
temporary, as backups shall leave the server fast.
Adopt the scripts, execute them (first the backup, then git upload).
Usage is just execute both scripts in a cron line like:
0 5 * * * /path/to/your/installation/w/backupper/cron.sh
e.g. run crontab -e
from the relevant user, install that line, done.