In our development process we use subversion as our source code control. When we update the code on our test environment from the command line using the svn up command. It it too much work to also login into SugarCRM and goto Admin->Repair->Quick Repair and Rebuild.
In an effort to stream line our process we added a command line utility to perform the Quick Repair and Rebuild for us.
Copy this code to /usr/bin/repair.php and give the file execute permission. When in your SugarCRM directory you can just run repair.php