Posted By

chupzzz on 06/27/11


Tagged

Shell drupal cron


Versions (?)

Run Drupal cron authorized


 / Published in: Bash
 

If you want to run your Drupal cron from logged in user you need to run this shell-script instead of clear wget.

  1. #!/bin/sh
  2. # Reference http://drupal.org/node/479948#comment-1673488 by pearlbear
  3.  
  4. SITE=http://yoursite.com/
  5. USERNAME=admin
  6. PASS=yourpassword
  7.  
  8. COOKIES=/tmp/cron-cookies.txt
  9. WGETPARAMS="--quiet -O /dev/null --no-check-certificate --save-cookies $COOKIES --keep-session-cookies --load-cookies $COOKIES"
  10. # if you run drupal in a default language different than English you need to modify this
  11. LOGIN="%D0%92%D1%85%D0%BE%D0%B4+%D0%B2+%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D1%83"
  12.  
  13. wget $WGETPARAMS "${SITE}user"
  14. wget $WGETPARAMS --post-data="name=$USERNAME&pass=$PASS&op=$LOGIN&form_id=user_login" "${SITE}user"
  15. wget $WGETPARAMS "${SITE}cron.php"

Report this snippet  

You need to login to post a comment.