• Applicable Software: MokonyxBackup
  • Min Version Number: 01.00.01
  • Max Version Number: Not Applicable

Overview

MokonyxBackup provides CLI commands via the Joomla console plugin (plg_console_mokonyxbackup). 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_mokonyxbackup/cli/mokonyxbackup.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, mokonyxbackup:run keeps running on the conservative defaults, so scheduled and unattended CLI jobs are never blocked.

Commands

mokonyxbackup:run

Run an immediate backup.

php cli/joomla.php mokonyxbackup:run --profile=1 --description="Nightly backup"
OptionShortDefaultDescription
--profile-p1Backup profile ID
--description-dCLI backupBackup description

Exit code is 0 on success, 1 on failure. The origin is recorded as cli.

mokonyxbackup:profiles

List all backup profiles (use this to find a profile ID).

php cli/joomla.php mokonyxbackup:profiles

Output columns: ID, Title, Type, Published.

mokonyxbackup:list

List backup records, newest first.

php cli/joomla.php mokonyxbackup:list --status=complete --limit=10
OptionShortDefaultDescription
--limit-l20Max records to show
--status-s(all)Filter: complete, fail, running

Output columns: ID, Profile, Status, Type, Size, Origin, Started.

mokonyxbackup:restore

Restore a completed backup by record ID. This overwrites the current site, so it prompts for confirmation.

php cli/joomla.php mokonyxbackup:restore 42
OptionDescription
--files-onlyRestore files only (skip the database)
--db-onlyRestore the database only (skip files)
--no-preserve-configRestore the archived configuration.php instead of keeping the current one
--password / -pDecryption password for encrypted archives

The record must be marked complete and the archive must still exist on disk.

mokonyxbackup:cleanup

Prune old backup records and archive files by age and/or count.

php cli/joomla.php mokonyxbackup:cleanup --max-age=14 --max-count=5
php cli/joomla.php mokonyxbackup:cleanup --dry-run
OptionDefaultDescription
--max-age30Delete backups older than N days
--max-count10Keep only the N newest backups
--dry-runfalseShow what would be deleted without deleting

mokonyxbackup: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 mokonyxbackup:snapshot create --types=articles,categories,modules --description="Before edit"
php cli/joomla.php mokonyxbackup:snapshot list
php cli/joomla.php mokonyxbackup:snapshot restore --id=5 --mode=replace
php cli/joomla.php mokonyxbackup:snapshot delete --id=5

Cron Integration

# Daily full backup at 2 AM
0 2 * * * cd /var/www/html && /usr/bin/php cli/joomla.php mokonyxbackup:run -p 1

# Weekly cleanup on Sundays
0 3 * * 0 cd /var/www/html && /usr/bin/php cli/joomla.php mokonyxbackup:cleanup --max-age=30 --max-count=10