Prefer the terminal? MokoSuiteBackup ships a full set of Joomla console commands to run backups, list records and profiles, restore, clean up old archives, and manage content snapshots — all driven by the same engine as the web UI and ready to drop into cron.
Overview
MokoSuiteBackup provides CLI commands via the Joomla console plugin (plg_console_mokosuitebackup). All commands run through Joomla's console entry point from the site root:
php cli/joomla.php <command> [options]
All commands run through the shared BackupRunner service, producing the same complete / warning / fail outcome as the web UI. A legacy standalone script (administrator/components/com_mokosuitebackup/cli/mokosuitebackup.php) is also bundled for existing cron setups.
CLI backups are one of the automated origins that are not gated by the execution-tuning wizard: even while that wizard is still pending on a site, mokosuitebackup:run keeps running on the conservative defaults, so scheduled and unattended CLI jobs are never blocked.
Commands
mokosuitebackup:run
Run an immediate backup.
php cli/joomla.php mokosuitebackup:run --profile=1 --description="Nightly backup"
| Option | Short | Default | Description |
|---|---|---|---|
--profile | -p | 1 | Backup profile ID |
--description | -d | CLI backup | Backup description |
Exit code is 0 on success, 1 on failure. The origin is recorded as cli.
mokosuitebackup:profiles
List all backup profiles (use this to find a profile ID).
php cli/joomla.php mokosuitebackup:profiles
Output columns: ID, Title, Type, Published.
mokosuitebackup:list
List backup records, newest first.
php cli/joomla.php mokosuitebackup:list --status=complete --limit=10
| Option | Short | Default | Description |
|---|---|---|---|
--limit | -l | 20 | Max records to show |
--status | -s | (all) | Filter: complete, fail, running |
Output columns: ID, Profile, Status, Type, Size, Origin, Started.
mokosuitebackup:restore
Restore a completed backup by record ID. This overwrites the current site, so it prompts for confirmation.
php cli/joomla.php mokosuitebackup:restore 42
| Option | Description |
|---|---|
--files-only | Restore files only (skip the database) |
--db-only | Restore the database only (skip files) |
--no-preserve-config | Restore the archived configuration.php instead of keeping the current one |
--password / -p | Decryption password for encrypted archives |
The record must be marked complete and the archive must still exist on disk.
mokosuitebackup:cleanup
Prune old backup records and archive files by age and/or count.
php cli/joomla.php mokosuitebackup:cleanup --max-age=14 --max-count=5
php cli/joomla.php mokosuitebackup:cleanup --dry-run
| Option | Default | Description |
|---|---|---|
--max-age | 30 | Delete backups older than N days |
--max-count | 10 | Keep only the N newest backups |
--dry-run | false | Show what would be deleted without deleting |
mokosuitebackup:snapshot
Create, restore, list, or delete content snapshots (articles, categories, modules) — a lightweight alternative to a full backup for content-only rollbacks.
php cli/joomla.php mokosuitebackup:snapshot create --types=articles,categories,modules --description="Before edit"
php cli/joomla.php mokosuitebackup:snapshot list
php cli/joomla.php mokosuitebackup:snapshot restore --id=5 --mode=replace
php cli/joomla.php mokosuitebackup:snapshot delete --id=5
Cron Integration
# Daily full backup at 2 AM
0 2 * * * cd /var/www/html && /usr/bin/php cli/joomla.php mokosuitebackup:run -p 1
# Weekly cleanup on Sundays
0 3 * * 0 cd /var/www/html && /usr/bin/php cli/joomla.php mokosuitebackup:cleanup --max-age=30 --max-count=10