PDA

View Full Version : If your scheduled tasks aren't working


amykhar
07-20-2005, 10:00 PM
I have seen some problems over at vbulletin.com about some scheduled tasks not running. Here is one possible fix.

If you are running an upgraded board, go to your scheduled tasks manager. Remove any scheduled tasks that are not installed by jelsoft and were not installed with a 3.5 modification.

The default ones that come with vbulletin are:
Daily Digest
Subscriptions
Daily Statistics Log
Event Reminder
Thread Views 07-10-2005
Hourly Cleanup #1
Attachment Views
Restore Temporarily Banned Users
Hourly Cleanup
User Promotions
Weekly Digest
Happy Birthday Email

One 3.5 mod I know of that adds one is my Velocity Modification.

If you are a 3.5 mod author and have created a mod that has an updated scheduled task, please let me know and I shall add it to this list.

Christine
07-21-2005, 09:02 PM
I don't have any added, but mine still aren't working.

I went through and saved each of them, which put them back to current 'next run time' but they didn't run as scheduled.

I wonder if there is a mismatch on the cron image vs what is being called? Haven't looked though.

tamarian
07-21-2005, 09:11 PM
vBouncer introduces 2 cron tasks, in 3.0.7 and in the 3.5 version.

vBouncer Clean
vBouncer Collect

Marco van Herwaarden
07-22-2005, 04:55 AM
If you have problems with cron jobs not running, the first you could try is reverting your footer template.

amykhar
07-22-2005, 05:54 AM
Did that. The scheduled task functions are running. The nextrun time is being updated and all that. It's just not running the actual code that it should run. BUT some tasks do work.

Marco van Herwaarden
07-22-2005, 06:02 AM
Is this a 3.5 specific thing you are talking about? I do know that in 3.0 the cron handling got it's own strange things, for example in handling global variables.

tamarian
07-22-2005, 11:39 AM
Amy, the tasks that fail to run by cron, do they actually run from the scheculed task manager by clicking "run now"?

amykhar
07-22-2005, 01:28 PM
Yes. They do, Tamarian.

tamarian
07-22-2005, 01:53 PM
Yes. They do, Tamarian.

O.k. I think I've seen this before, the task runs from the rask manager, but fails to run as a cron.

Does the failed cron task file contain any function declaration(s)? If so, removing those functions and opting for a single block of code fixes this.

Marco van Herwaarden
07-22-2005, 01:58 PM
I had the same problem with my Thread of the Week hack for 3.0.7.

If you use a global variable inside a function, things work strange. Best to pass all used variables as parameters to the functions.

amykhar
07-22-2005, 02:06 PM
No functions and no global variables in this one. And, it worked no problem under 3.0.7. I simply updated it to use the correct 3.5 $db instead of $DB_site.

Plus, one of the jelsoft cron tasks doesn't seem to run either.

Amy

tamarian
07-22-2005, 02:24 PM
Plus, one of the jelsoft cron tasks doesn't seem to run either.

Which one? It may add an extra clue.

There is definitly something weird going on, and we know so far that it only occures as a cron, but works from the task manager.

amykhar
07-22-2005, 02:29 PM
The one that restores temporarily banned users. I have it set to log even if nobody is banned.

tamarian
07-22-2005, 02:40 PM
The one that restores temporarily banned users. I have it set to log even if nobody is banned.

For some reason, vB devs commented out the else part in that file. So it will not log anything, if nothing was done, regardless of the setting to log. You might want to uncomment that part (if you haven't done that), just to make sure if it is, or isn't, running.

Edit: it will also need " log_cron_action($logmessage, $nextitem);" :)

amykhar
07-22-2005, 02:44 PM
I did :) That's how I set it to log even if it didn't ban anybody. ;)

tamarian
07-22-2005, 02:50 PM
O.k., the plot thickens, this should be interesting to find out. I'll go browse the bug tracker :)

EDIT: This is a new post, 7 hours later, merged automatically as duplicate. So I think it will not generate a notification!!

Amy, not sure if this helps, but I was unable to duplicate your problem with removebans.php I added a couple of numbered:

log_cron_action(' test 1 ', $nextitem);

statements and they showed up in the cron log through the cron method.

I still think there's something weird with crons, but removebans didn't help narrow it for me :)

Christine
07-24-2005, 06:38 PM
I just added 3 crons, set to run every 5 minutes (not big ones, they just close any open threads that have a post count over 250 since I can't get that working again as a plugin).

I also went live on 3.5 today, so have 200+ users pounding the forum right now.

They are running just fine.

I don't have any temp-banned users to test the other though as we have only been using permanent bans to this point.

lovechandigarh
11-21-2008, 11:35 AM
am facing a similar problem with 3.7.4 Any clues?

Lynne
11-21-2008, 02:32 PM
You should start your own thread with all the pertinent information for your problem.