Posted by d.cox on August 18, 2010 at 3:28pm
I found some information @ drupal.org/cron but wonder if this is the right way to do it in the Aegir system?
Running cron as an authenticated user
SITE= site-url
USERNAME=user.name
PASS=ChangeMe!!12
COOKIES=/tmp/cron-cookies.txt
WGETPARAMS="--quiet -O /dev/null --no-check-certificate --save-cookies $COOKIES --keep-session-cookies --load-cookies $COOKIES"
# if you run drupal in a default language different than English you need to modify this
LOGIN="Log%20in"
wget $WGETPARAMS "${SITE}user"
wget $WGETPARAMS --post-data="name=$USERNAME&pass=$PASS&op=$LOGIN&form_id=user_login" "${SITE}user"
wget $WGETPARAMS " ${SITE}cron.php"
Comments
Aegir runs cron
I believe Aegir runs cron for all your sites via a drush command and therefore shouldn't need to authenticate against Drupal. Is there some add-on/module you are using in Drupal that requires this? On sites where we aren't using Aegir, we also use Drush to call cron. G.D.O keeps telling my post is not going to be accepted when I try to enter my example drush cron line, so I cannot show an example.
Thanks for the response
Thanks for the response Tim,
I am using PDF to ImageField, it generates jpeg images of an uploaded PDF file. It generates the images on cron run using ImageMagick.
When I run cron manually on the site from the report status page it works great and shows user 1 ran cron. But when cron runs as scheduled it fails, do to the anonymous user not have permission.
I guess in that case you
I guess in that case you would need to run cron as an authenticated user as you suggest. I saw your bug report at the PDF to ImageField issue queue, so hopefully you get some clarification there. As for Aegir and cron, you can always setup another crontab using the credential method you describe and set it to your own schedule. Aegir cron will still run if you want, but will always fail on the PDF task. You can disable Aegir's cron feature in the web front-end I believe, although I'm still using alpha7, so I'm not sure if this has changed in the latest versions of Aegir.
-Tim