Administering Joomla from the Command Line
Joomla includes several command‑line interface (CLI) applications that allow administrators to automate tasks without logging into the web interface. On ruachost.com, these scripts can be run manually or scheduled with cron jobs to streamline site management.
Why Use the Command Line?
Section titled “Why Use the Command Line?”- Automates repetitive tasks such as cache cleanup and indexing.
- Saves time by running scripts directly without using the Joomla admin panel.
- Useful for advanced administrators managing multiple sites.
Available Joomla CLI Applications
Section titled “Available Joomla CLI Applications”1. Purging Expired Cache Files
Section titled “1. Purging Expired Cache Files”-
Script:
garbagecron.php -
Removes expired cache data to reduce disk usage.
-
Example command:
Terminal window cd ~/public_html/cliphp garbagecron.php
2. Checking for Extension Updates
Section titled “2. Checking for Extension Updates”-
Script:
update_cron.php -
Downloads update information for installed extensions.
-
Example command:
Terminal window cd ~/public_html/cliphp update_cron.php
3. Deleting Old Files After an Update
Section titled “3. Deleting Old Files After an Update”-
Script:
deletefiles.php -
Cleans up leftover files after Joomla updates.
-
Example command:
Terminal window cd ~/public_html/cliphp deletefiles.php
4. Managing Smart Search Indexing
Section titled “4. Managing Smart Search Indexing”-
Script:
finder_indexer.php -
Updates or rebuilds the Smart Search index.
-
Example commands:
Terminal window cd ~/public_html/cliphp finder_indexer.phpphp finder_indexer.php --purge
Writing Custom CLI Applications
Section titled “Writing Custom CLI Applications”- Joomla provides a Framework for building custom PHP CLI scripts.
- Developers can extend Joomla functionality by writing scripts for specific tasks.
- More information: Joomla Framework.
Important Notes
Section titled “Important Notes”- These scripts are located in the
clidirectory of your Joomla installation. - If Joomla is installed in a subdirectory, navigate to that directory first.
- Always back up your site before running or modifying CLI scripts.
- Cron jobs can be configured to run these scripts automatically.