Cron Job Triggering

Discussion in 'Standard Support' started by teoyh, Apr 14, 2012.

Thread Status:
Not open for further replies.
  1. teoyh Member

    Level: Standard
    Can I just comfirm that to trigger my cron job all I need to do is to hit my homepage

    eg http:\\

    many thanks
  2. jfquestiaux Well-Known Member

    Level: Professional
    You don't even need to add "fabrik_cron=1" to get it triggered.
  3. teoyh Member

    Level: Standard
    So what you mean is as long as that is hit on my hokepage the cron will run?
  4. jfquestiaux Well-Known Member

    Level: Professional
    Yes. That is correct.
  5. cheesegrits Support Gopher

    Level: Community
    Actually, a hit on any J! front end page triggers our cron plugin.

    It runs as the very last thing, after J! has sent all it's output. It checks our 'fabrik_cron' table, to see if there are any tasks which need running (based on the their "run every ..." and "last updated" values, and whether a query string arg is required), and if so, it runs them (and updates their 'last run' time).

    NOTE that the drawback (which I'm working on fixing in f3) with this is that you never know what user level the page load will have, so you may have problems with tables that have ACL / user based pre-filters. Because the scheduled task will only run with the permissions of the currently logged on user that loaded the page.

    -- hugh
  6. teoyh Member

    Level: Standard
    I had an email cron schedule to send out reminder to approving officer who had not yet approved leaves.

    I added this condition
    return '{leave_record___leave_status}' =='AWAITING RO APPROVAL' || '{leave_record___leave_status}' =='AWAITING AO APPROVAL';

    Set the log event to : YES
    Set the Require querystring to : Yes

    When I manually run the cron email task from the event log I can see in the log that say sent condition returned false: return 'APPROVED' =='AWAITING RO APPROVAL' |.
    Which is correct as I got 2 records one had been approved and the other still waiting for RO to approve. I also received the email in the inbox.

    I register an account in for free to slap my home page every minute. From my domain control panel i can see that that is hit return.

    But without me clicking the run everything goes silent :(

    Did I miss out anything ?
  7. jfquestiaux Well-Known Member

    Level: Professional
    You have to set "Set the Require querystring' to "No".
    If you set it to 'Yes' in fact you de-activate the triggering by the hit to the homepage. Instead, the plugin is triggered by a special querystring to add to the URL. It is used when you want to perform a cron at a definite moment independant of the traffic on the site.
    1 person likes this.
  8. teoyh Member

    Level: Standard
    Thank you so much for pointing out mine mistake , my cron job finally set sail :)
  9. jfquestiaux Well-Known Member

    Level: Professional
    Glad I could help. Think about closing your thread if the issue is resolved.
  10. teoyh Member

    Level: Standard
    Many thanks...Fabrik is awesome...closing thread
Thread Status:
Not open for further replies.

Share This Page