Archive for January 5th, 2009




Cron-sters under the bed

According to gotDrupal.com, cron.php is not, by default, protected by permissions.  This means that anyone can go to your site and type “cron.php” and make it fire, possibly causing the server to start working very hard.

How do you deal with these Cronsters? (And really, who are you anyway – who does that?).  I don’t know.  Time to keep watching! Ah… editing the .htaccess file.  Hmm.  I guess I’m not dealing with Cronsters today! (i’m developing on localhost, so right now, the threat is moot). I must remember to reinvestigate this as we come closer to production goals and deployment.

Add comment January 5, 2009

need Cron-ik

I’m pretty sure that a bit o’ chronic would help with this (even though I never use the stuff), being rather illiterate in OS technologies and command line interfaces.  In any case, I seem to have set up the crontab on my OSX.  For future reference, this is how I did it.

! Important Points.

From gotDrupal.com:

  1. Cron is an old technology that can be harnessed by Drupal.  Cron.php is not that technology – it is a script that comes with drupal which allows Drupal’s modules to execute at scheduled times via some form of Cron technology.

From Lynda.com tutorials (if you’re logged in to Lynda.com, click here):

  1. Cron can be harnessed directly from the OS, or from the web via web-based cron services.
  2. If OS, cron can come in a number of forms depending on your OS. The three mentioned are wget, lynx, and curl.  These are cron programs that may be installed on your OS, and will most likely be accessed via command line. On Windows – use Scheduled Tasks.

My setup:

Mac OSX.
I need to use Terminal to figure out which cron to use.
Turns out I have CURL.

Instructions:

  1. Fire up Terminal (Applications >> Utilities >> Terminal)
  2. Use “whereis ____” to find the right cron.  Whereis lynx, whereis curl, whereis, wget.
  3. whereis curl should work, and should swtich to the directory in which it is located.
  4. Type: crontab -e.   This puts you into the crontab – the text file that will schedule cron via curl.  You’ll notice that Terminal has switched to a program called VI (“VIM”).
  5. Type the following: 45 * * * * <directory of curl> –silent –compressed  <directory of site’s cron script>
    So for me: 45 * * * * /usr/bin/curl –silent –compressed http://localhost/drupal/cron.php
  6. Hit ESC to get out of VI.
  7. Type :wq (I think that means save and quit).

Be Careful: that colon is crucial to being able to type again and not smash the keyboard, lol.

2 comments January 5, 2009

Pages

Categories

Links

Meta

Calendar

January 2009
M T W T F S S
« Dec   Feb »
 1234
567891011
12131415161718
19202122232425
262728293031  

Posts by Month

Posts by Category