MyBB Community Forums
Can I use task manager as cron job? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Can I use task manager as cron job? (/thread-165221.html)



Can I use task manager as cron job? - marcus123 - 2015-01-06

I have a file on my other domain that  needs cron job but my hosting doesn't have it! How can I use mybb task manager to open/execute some external URL?


RE: Can I use task manager as cron job? - dragonexpert - 2015-01-06

You need the file that has the code to be executed in the /inc/tasks folder. You then can go to the Admin CP and create a new task for it.


RE: Can I use task manager as cron job? - marcus123 - 2015-01-06

Thanks buddy! One question!


Can I simply add to my task file:

<?php
header("Location: http://www.example.com/cron/run.php");
exit;
?>

will this open the URL?

What do you recommend?


RE: Can I use task manager as cron job? - marcus123 - 2015-01-07

Buddy what should I put there?


RE: Can I use task manager as cron job? - Destroy666 - 2015-01-08

Put the actual code there in a task function.
<?php

function task_enterthenameofilespecifiedinacphere($task)
{
//code
}



RE: Can I use task manager as cron job? - marcus123 - 2015-01-08

Thanks buddy D666 happy new year by the way Smile


RE: Can I use task manager as cron job? - pavemen - 2015-01-09

remember that this isn't a true cron job. it will only run the first page view after the expected run time. So it is dependent on your site's traffic. Also, there is (or was) a hard coded limit of 5 minutes between task runs, regardless of the setting for the task itself.