| OsProject | |
|---|---|
| id | MediaWikiServerTools |
| state | active |
| owner | WolfgangFahl |
| title | MediaWikiServerTools |
| url | https://github.com/WolfgangFahl/MediaWikiServerTools |
| version | 0.2.7 |
| description | MediaWiki Server Management System - Apache Site management, SQL backups, cron-based backups |
| date | 2026-07-05 |
| since | 2021-01-01 |
| until | |
pip install MediaWikiServerTools
# alternatively if your pip is not a python3 pip
pip3 install MediaWikiServerTools
# local install from source directory of MediaWikiServerTools
pip install .
pip install MediaWikiServerTools -U
# alternatively if your pip is not a python3 pip
pip3 install MediaWikiServerTools -U
Installed as console scripts (e.g. via pipx install MediaWikiServerTools):
Combines a database backup with retention-based expiration in a single command.
-b / --backup — dump the database(s) into <backup-dir>/today and create a dated archive sql_backup.YYYY-MM-DD.tgz (the archive is created automatically after the dump)-e / --expire — apply the retention rules; dry-run unless -f is given--all — expire, then backup--database DB — back up a single database (default all)--native — use the native client (sudo mysql / sudo mysqldump -u root); for hosts running MariaDB/MySQL directly--docker CN — use the docker container CN via the mysqlr wrapper--backup-user USER — OS user that owns the backup files (default backup)--mysql-root-cmd / --mysqldump-cmd override the backend selection--native nor --docker is given: the legacy --container docker wrapper--timeout SECONDS — timeout for each SQL dump/command and the tar archive step (default 3600 s). Before 0.2.7 dumps were killed after the RunConfig default of 10 s and tar after 60 s — fatal for real databases (a 57 GB dump takes ~22 min, its tar ~40 min; size the timeout with headroom, e.g. --timeout 21600 for nightly production use).ERROR line to the log and the process exits non-zero (before 0.2.7 a failed backup could exit 0 silently — issue #11).Number of backups kept per bucket: --days (7) · --weeks (6) · --months (8) · --years (4).
--backup-dir — default /var/backup/sqlbackup (today/ holds the per-database dumps; tmp/ is the work area — both stay local)--archive-dir — where the dated .tgz archives + expiration live; may be a remote/mounted path, e.g. an SSHFS-mounted storage box (defaults to --backup-dir)--log-file — default /var/log/sqlbackup/sqlbackup-YYYY-MM-DD.log# nightly: expire old archives, then back up all databases;
# dumps stay local, dated .tgz archives land on the SSHFS-mounted box
cronbackup --all -f --native --timeout 21600 \
--backup-dir /var/backup/sqlbackup \
--archive-dir /mnt/storage-box-vm2180/vm2180/sqlbackup \
--days 14 --weeks 8 --months 24 --years 10
Requires pyExpireBackups (provides the expirebackups module used by cronbackup). This was added to the package dependencies in 0.2.6 — see issue #10.