Big Scheduled Tasks Problem!

costar

New Member
Hey,
I don't know why but for some reason all of the sheduled tasks dont work!? They are all setup properly and should work but they just dont work.
 
What version vB are you using?

Also be aware that vBulletin was designed so that scheduled tasks are run in direct correlation to your forum users. In other words you must have visitors or members come to your site in order for cron to execute properly.

I know its not how it should be but its how Jelsoft designed the software because page refreshes are required.

If visitors to your forum is not the issue then perhaps you installed a plugin/mod that's preventing your cron jobs from executing.

Find the offending hack/mod/plugin and remove it! Start with the latest plugin/mod you installed and work your way backwards.

You can execute the cron manually of course by duplicating the cron exec system.

One possible solution is to go to the plugin manager and create a global_complete plugin.

Then add the following code to execute the cron:

Code:
{
    require_once(DIR . '/includes/functions_cron.php');
    
    if (!defined('NOSHUTDOWNFUNC') AND !$vbulletin->options['crontab'])
    {
        vB_Shutdown::add('exec_cron');
    }
    else
    {
        $cronid = NULL;
        if ($vbulletin->options['crontab'] AND SAPI_NAME == 'cli')
        {
            $cronid = intval(vbrand(1, 1000000));
            // if its a negative number or 0 set it to NULL so it just grabs the next task
            if ($cronid < 1)
            {
                $cronid = NULL;
            }
        }
    
        exec_cron($cronid);
    }
This will force the cron to run all your pending scheduled tasks/cron jobs successfully and automatically.

One last thought... did you mod your footer template? Perhaps you removed $cronimage by accident.

If so restore it to its original configuration or add $cronimage back into the footer template. If you did not mod your footer template, then review your scheduled tasks and see if there's any unusual pending tasks that may be causing a parsing error of some sort.

I'm sure other members will have alternative solutions.

Good Luck!
 
i use vB 3.8.0 and I have at least 5 members online all the time. the main problem is that I have member promotions set up and when a member reches a certain amount of posts he gets promoted and that doesn't work because the scheduled task doesnt work.
 
This will be easier for you, just create a new plugin as follows:

Admincp-->Plugin & Products-->Add New Plugin

Enter the following variables:

Product--> vBulletin
Hook Location--> global_complete
Title--> Cron Exec
Execution Order--> 1
Plugin PHP Code-->

Code:
{
    require_once(DIR . '/includes/functions_cron.php');
    
    if (!defined('NOSHUTDOWNFUNC') AND !$vbulletin->options['crontab'])
    {
        vB_Shutdown::add('exec_cron');
    }
    else
    {
        $cronid = NULL;
        if ($vbulletin->options['crontab'] AND SAPI_NAME == 'cli')
        {
            $cronid = intval(vbrand(1, 1000000));
            // if its a negative number or 0 set it to NULL so it just grabs the next task
            if ($cronid < 1)
            {
                $cronid = NULL;
            }
        }
    
        exec_cron($cronid);
    }

Plugin is Active--> Yes

Then Save

Note: You can turn the plugin on and off as you see fit
 
Back
Top