How to clear cache externally?
If you are running a script, you'll likely benefit from using Drush.  With the Drush php-eval and php-script commands, you can easily call a snippet of php code (such as the examples shown in other answers to this question) after bootstrapping Drupal.  Without Drush, you would have to set up a web service and use wget or curl to run your code, or try to call the Drupal bootstrap code yourself.  Better yet, Drush even comes with a built-in command to clear the cache, so you don't need to worry about writing any php code at all, if that's all you want to do from your script.  Just use:

cd /path/to/drupal/sites/default &amp;&amp; drush cache-clear all


You may also wish to learn about site aliases; if you define an alias called @site, then you can instead use:

drush @site cache-clear all