Sunday, January 17, 2010

drupal cron for multiple sites

There are times when we have multiple site to maintain for our drupal based websites.
One way to do it is by doing a shell script.
But i would prefer to do it using php script instead:


$aSites = array(
foreach( $aSites as $sSite ):
$sContent = file_get_contents($sSite);
echo "Retrieved: " . $sSite . "\r\n
echo substr($sContent,0, 100) . "...\r\n

And setup the cron in cpanel:
php [path_to_your_php]/runcron.php
etc.: php /home/ > /dev/null

Hope this is helpful :)

No comments: