Purge Trash Script

Last Updated: 20 Jan 2018

The purge_trash.php script located in the /scripts directory allows you to purge the trash using the command line as opposed to the Purge Trash function within the Admin interface. It can be added to the system crontab and automatically run at regular intervals to purge the system trash.

Parameters:

  • [SYSTEM ROOT] - The Matrix system's root directory.
  • [PURGE ROOTNODE] (optional) - The root node of the Trash you want to purge. If an asset ID is provided, only this asset and its child assets will be purged instead of the entire trash. If it is omitted, the entire trash will be purged.

Example:

$ sudo -u 'apache' php scripts/purge_trash.php $(pwd) 20447
[2018-01-20 20:24:11] 0 / 10 (0%)
[2018-01-20 20:24:16] 10 / 10 (100%)

Previous Chapter Next Chapter