Let your visitors run Drupal cron for you
Sometimes (or mostly on shared hosts) wo dont have ssh/shell acces to server to configure crontab. In this case we need to run crons manually or register for a paid cron-service or find an other solution. For my solution I need just one visitor a day to request a hidden img-tag. And its working; at least once a day Drupal runs cron.php.
- Create a block called something like "run cron manually"
- Activate your block; move to footer region etc
- Put following code and save as PHP-Filter (input format)
Code for "run cron manually with a footer block"
$now = time();
$last_run = variable_get("cron_last_run", 0);
if( $now-$last_run > 86400 ){
variable_set("cron_last_run", $now);
return "<img src=\"/cron.php\" width=1 height=1 border=0>";
}
Similar entries
- Delete all spam node entries of a spesific user on a Drupal site with PHP
- Page generation time and http-referers with PHP
- Drupal LDAP to copy Win.Server.AD groups to roles
- Web2 Style CSS Dynamic Menu with Arrows and Background-Images
- PHP Block for Custom Role under Drupal 6
- 'Similar entries' block cannot be changed on Drupal
- DropDown / Rollover Menu with pure CSS / HTML
- 'Similar entries' block cannot be saved
- Pure CSS Mouseover Menu without Javascript
- Between operator in PHP
- Backup all MySQL databases automagicly with the PHP admin script
- How to add new sites to Drupal's service links module?
- Suhosin blocks Drupal Modules
- Common HTML / Web colors
- Add to Facebook Block for Drupal
- Joomla structure confusing
- Web2 style secure & flexible free php contact form with easy setup
- Register Globals Emulator for PHP
- Recreate all teasers on Drupal
- E: Sub-process /usr/bin/dpkg returned an error code (1)

Post new comment