日期:2014-05-16  浏览次数:20824 次

linux下面cron服务 用drupal授权用户执行cron.php

?

SITE=https://www.xxx.com/

USERNAME=username

PASS=password

?

COOKIES=/tmp/cron-cookies.txt

WGETPARAMS="-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"

?

前提是登录页面必须没有验证码校验的功能。