ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Cron Plugins

July 16, 2007 9:27am

Subscribe [0]
  • #1 / Jul 16, 2007 9:27am

    medic119

    52 posts

    I am trying to use a couple of the EE Cron Plugins.  Yes, I have the EE Cron plugin as well.  For some reason my brain is not making the specific neurotransmitter connection to understand the usage of the plugin. (Must be the 138 F degree weather here) 

    Do the exp:cron whatevers have to be loaded in a template somewhere within the site so they are triggered when someone loads the template (like the moblog checker works), or can I just create a separate unreferenced template in my hidden system templates and EE will handle it automatically?

    Thanks..

  • #2 / Jul 16, 2007 11:23am

    Robin Sowell

    13255 posts

    The tag has to be on a template that will be loaded- like the moblog check.  PHP can’t run a ‘true cron’- a page load has to kick off the date check and things will follow from there.

    Make sense or is it still fuzzy?

  • #3 / Jul 16, 2007 1:46pm

    medic119

    52 posts

    Yea, thats pretty much what I figured, but its amazing how sometimes you can stare at something and its just doesn’t come into focus.. 😊

  • #4 / Aug 14, 2007 1:50pm

    Erin Dalzell

    790 posts

    I am still a little confused. If I want something run every hour, but the template that the cron plugin tag is on only gets loaded once a week, how does it work?

    Why use this instead of just putting the command you want run in the template?

    I must be missing something.

  • #5 / Aug 14, 2007 1:54pm

    Lisa Wess

    20502 posts

    Hi, Erin,

    If the template is only visited once a week then the cron will only be triggered once a week.

    You would use this rather than the direct command for something you don’t want happening on *every* template load, but happening regularly, like a database backup or some such.

  • #6 / Aug 14, 2007 1:57pm

    Erin Dalzell

    790 posts

    Ah, OK. I just saw in the LinkList documentation that the check-for-update functionality could be put in a cron job and got confused.

    Thanks

  • #7 / Sep 04, 2007 1:11am

    rmeder

    97 posts

    Is there a unix style command for linklist or do I have to put the tag in a template and call that file from cron? 

    Regards,

    Rick

  • #8 / Sep 04, 2007 1:25am

    Lisa Wess

    20502 posts

    As far as I know it has to go into a template, but you could probably create a standard cron job to visit that template so your visitors don’t have to.

  • #9 / Sep 04, 2007 1:44am

    rmeder

    97 posts

    Thanks Lisa!  Yes, my plan is to just pull up the page via lynx.  I just noticed a reference to entering a cron entry for it in the linklist docs and then searched the forums and found these posts and figure I would ask just in case 😊.

    As always… thanks for your prompt response!

  • #10 / Sep 17, 2007 3:22pm

    GDmac - expocom

    350 posts

    For the somewhat advanced users… you could look at the system crontab for
    more precise timed jobs. I first tried on my local mac and our (linux) server if
    it could run php from the shell. Type: “php—help” if that works then basically
    you’re able to add cronjobs like “php dostuff.php”

    An alternative (i just found googling) if you don’t have lynx by default (like me on a mac),
    or don’t wanna hassle with tricky specific php for the command-line, you could
    use “curl” instead “curl http://example.com/cron.php >> ~/somedir/logfile”
    (found via: clampcampus.com/ ... /crontab wordpress or shell scripting for dummies)

  • #11 / Sep 17, 2007 3:45pm

    rmeder

    97 posts

    Yes, curl works well.  That is what I ended up using.  I setup the commands on wanted to run in a script and ran the script via cron.  Very simple.

    For anyone that is reading this post and needs help.  Here’s a copy of the script file that I created.
    hrly_crons.sh

    #!/bin/bash
    /usr/bin/curl -s <a href="http://domain.com/amember/cron.php">http://domain.com/amember/cron.php</a>
    /usr/bin/curl -s <a href="http://domain.com/index.php/crons/">http://domain.com/index.php/crons/</a>

    Regards,

    Rick

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases