<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Victor and Greg, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks for your help.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Just for your information, I am setting up a 
non-ESL site on Drupal, so this isn't for the site you saw Victor. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>My host has a cron job section of the control 
panel, so that doesn't seem as if it will be too difficult.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am now looking into getting my first ever crontab 
set up just so I can see it working, then I'll worry about setting up the script 
itself to update user roles. I have never set up a cron job before so I am 
taking baby steps, where to put the script, where to set up the schedule. There 
seems to be a lack of "Cron Jobs for Idiots" type tutorials on the web, but I'll 
keep lookiing.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>That DB Cron module looks very useful Greg, 
although it's not available in 5.1.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'll keep looking into this and thank you both once 
again.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Neil</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=victorkane@gmail.com href="mailto:victorkane@gmail.com">Victor 
  Kane</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=support@drupal.org 
  href="mailto:support@drupal.org">support@drupal.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, March 09, 2007 12:29 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [support] Setting up cron 
  job for user role updates</DIV>
  <DIV><BR></DIV>It's always been my wish to run an ESL site!<BR>I taught ESL 
  for many years until getting into IT in the late eighties. My whole purpose of 
  getting into IT was to seek help for my teaching academy, but once in the new 
  realm, I was caught up entirely by it :) <BR><BR>So I certainly would like to 
  help you.<BR><BR>Running cron is part of the realm of the operating system, 
  outside of Drupal.<BR><BR>Your hosting company will allow you to edit cron via 
  a panel; they may force you to edit cron directly through text you enter, or 
  they may have some kind of interface to make life easy for you. <BR><BR>If 
  that is not the case, then you will have to fill in something like the 
  following:<BR><BR># m h&nbsp; dom mon dow&nbsp;&nbsp; command<BR>0&nbsp;&nbsp; 
  3&nbsp;&nbsp; *&nbsp;&nbsp; *&nbsp;&nbsp; *&nbsp;&nbsp; wget -O - -q <A 
  href="http://mentor/drupal/cron.php">http://mentor/drupal/cron.php 
  </A><BR><BR>Please see the excellent documentation on the Drupal site at <A 
  href="http://drupal.org/cron">http://drupal.org/cron</A> which explains all 
  and gives alternatives to wget. There are also instructions for certain 
  hosting companies like Dreamhost, etc. Check out the comments at the bottom of 
  the page for some illuminating explanations. <BR><BR>Drupal has a poormanscron 
  module, but I would recommend running cron directly.<BR><BR>Once you have done 
  this, you can now enable the core search module which will index your site, 
  and you will be able to supplement the pearl script you are currently using 
  with Drupal's powerful built-in search facilities. <BR><BR>You should do this 
  first, at least for testing purposes, to make sure you have cron 
  running.<BR><BR>For your second step, you need to write a module which 
  implements <BR>The file cron.php invoked by cron calls <A 
  href="http://api.drupal.org/api/5/function/drupal_cron_run">http://api.drupal.org/api/5/function/drupal_cron_run</A> 
  and this&nbsp; some housekeeping and then invokes all module implementations 
  of hook_cron().<BR><BR>The search module, for example, does the 
  following:<BR><BR style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">/**</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp;* Implementation of 
  hook_cron().</SPAN><BR style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp;*</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp;* Fires hook_update_index() 
  in all modules and cleans up dirty words (see </SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp;* search_dirty).</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp;*/</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">function search_cron() {</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp; // We register a shutdown 
  function to ensure that search_total is always up</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp; // to date.</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp; 
  register_shutdown_function('search_update_totals');</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp; // Update word 
  index</SPAN><BR style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp; foreach (module_list() as 
  $module) {</SPAN><BR style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp;&nbsp;&nbsp; 
  module_invoke($module, 'update_index');</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">&nbsp; }</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><SPAN 
  style="FONT-FAMILY: courier new,monospace">}</SPAN><BR 
  style="FONT-FAMILY: courier new,monospace"><BR>You would need to write a 
  module which, in its modulename_cron() function effectively iterates over the 
  users and carries out the changes you propose.<BR><BR>Cheers, <BR><BR>Victor 
  Kane<BR><A 
  href="http://awebfactory.com.ar">http://awebfactory.com.ar</A><BR><BR>
  <DIV><SPAN class=gmail_quote>On 3/9/07, <B class=gmail_sendername>Neil: <A 
  href="http://esl-lounge.com">esl-lounge.com</A> </B>&lt;<A 
  href="mailto:neil@esl-lounge.com">neil@esl-lounge.com</A>&gt; wrote:</SPAN>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV bgcolor="#ffffff">
    <DIV><FONT face=Arial size=2>Here is my wish: to run a cron job a few times 
    a day to update all Authenticated Users to Full Members once they have 
    posted five comments/forum posts.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>My plan is to have all comments posted by 
    Authenticated Users moderated but move users up to the Full Members role I 
    will create to cut down on moderation work. How would I go about doing this? 
    Is there any documentation on <A 
    onclick="return top.js.OpenExtLink(window,event,this)" 
    href="http://drupal.org" target=_blank>drupal.org</A> about setting up cron 
    jobs? There don't seem to be any modules to allow this. Userpoints exists 
    but isn't free. A simple cron job seems to be the easiest solution all 
    round. Has anyone else put something like this in place?</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>Neil</FONT></DIV></DIV><BR>--<BR>[ Drupal 
    support list | <A onclick="return top.js.OpenExtLink(window,event,this)" 
    href="http://lists.drupal.org/" target=_blank>http://lists.drupal.org/</A> 
    ]<BR></BLOCKQUOTE></DIV><BR>
  <P>
  <HR>

  <P></P>-- <BR>[ Drupal support list | http://lists.drupal.org/ 
]</BLOCKQUOTE></BODY></HTML>