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 deleteOldRevisions.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 /maintenance/rebuildall.php

[/] # php /maintenance/rebuildall.php

[/] # php /maintenance/deleteOldRevisions.php --delete

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