title: How to get Drupal's $base_url to work on a cron job?
body: <p>How to get $base_url to show the correct url for my Drupal site when I'm running a cron job?  Do I have to set the global $base_url manually for that to happen?  Do I have to run the cron job as a registered user?</p>
  
  <p>When I run mysite.com/cron.php by hand everything seems to work fine: $base_url is set to the correct url.  However, when I run a similar command via cron or drush, $base_url is set to a generic "http://default".</p>
  
  <p>The funny thing is that when I run cron manually as a registered user from inside Drupal (using devel, for instance), $base_url aways points to the right url.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Leo</p>