Skip to content

Instantly share code, notes, and snippets.

@tobiassjosten
Created October 1, 2009 07:48
Show Gist options
  • Save tobiassjosten/198813 to your computer and use it in GitHub Desktop.
Save tobiassjosten/198813 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# drupal-cron - a shell script for running cron.php on Drupal installations.
SITES=$(grep -r 'ServerName' /etc/apache2/sites-enabled/)
for site in $SITES ; do
if [[ "$site" == ServerName || "$site" =~ /etc/apache2/sites-enabled/* ]]; then
continue
fi
site=$(expr match "$site" '\([^:]*\)');
wget -q -O /dev/null --header="Host: $site" http://127.0.0.1/cron.php
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment