Manual:DeleteOldRevisions.php

deleteOldRevisions.php is a script that Deletes old (non-current) revisions from the database. (according to the source code)

This script deletes page histories. If you run a GFDL licensed wiki you need to be aware that the GFDL requires you to keep the page histories.

Remember to use the --delete flag to confirm that you want to delete the items matched:

php deleteOrphanedRevisions.php --delete

Otherwise the script will only display the number of items that it can delete.

Example
[/] # find / -name php /mnt/ext/opt/apache/bin/php

[/] # find / -name rebuildall.php /share/MD0_DATA/Web/mediawiki-1.18.3/maintenance/rebuildall.php

[/] # /mnt/ext/opt/apache/bin/php /share/MD0_DATA/Web/mediawiki-1.18.1/maintenance/rebuildall.php

[/] # /mnt/ext/opt/apache/bin/php /share/MD0_DATA/Web/mediawiki-1.18.1/maintenance/deleteOldRevisions.php --delete

NB: The rebuildall.php can take long...