Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2012, 10:04 AM
lukescotty lukescotty is offline
 
Join Date: Jul 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Cron Job, really doing my head in, please help

Hiya

I've been at this for days!!! maybe someone on here could put me out of my misery.

I've set up a cron job on my Cpanel to run rssposter.php every 10mins, On the server it shows its excuting the cron job correctly, but its just not posting in my forum threads.

Its doing my head in!! I just want to elimate this cronimage way and have my rssposter run every 10mins, updating all the twitter feeds

I works when I manually select run now on the rssposter, but not automatically. I've tried all these mod related to it, but there like 7 years old some of them and there not functioning correctly

Please help guys!! i wana smash something up

Regards lukescotty
Reply With Quote
  #2  
Old 04-20-2012, 10:34 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't run rssposter.php directly or it will just exit. It's meant to be run through cron.php. You could run cron.php in your cron job, but I guess it only runs one pending job and you don't know that it will be rssposter.php.

You asked about this a while back and I remember looking around a little and seeing a script that someone wrote that makes sure all the scheduled tasks run so that you can run it once from a cron job - did you find that?
Reply With Quote
  #3  
Old 04-20-2012, 10:43 AM
lukescotty lukescotty is offline
 
Join Date: Jul 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you sent me the link to this one https://www.vbulletin.com/forum/show...ron-VBIV-13733

"You can already do this and have been able to do it since 3.7.0 or so.

Use command line PHP and run it as a true cron job.

cd /path/to/cron.php; php /path/to/cron.php

I've posted this multiple times over the years."

but theres alot of debate on this. i've tried it, but its not being working

not understanding this run once, part of ur answer. Don't i want in to run more than once? or do you mean run once.... and its continious?
Reply With Quote
  #4  
Old 04-20-2012, 10:55 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand everything that's mentioned in that thread, but you could try this: Go to the scheduled task manager and find the id for the RSS poster task (edit the task and it should be at the top of the edit window). Then when setting up your cron job, make it "cron.php X" where X is the id. For instance, mine says the id is 17, so the command would be

cron.php 17
Reply With Quote
  #5  
Old 04-20-2012, 01:02 PM
lukescotty lukescotty is offline
 
Join Date: Jul 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this ID is the same too "17"

So i've created a new cron job "php /home/sheffiel/public_html/talknightlife.co.uk/cron.php 17" and it runs every 10 mins, but still no joy, do i need to remove the cronimage on the footer? are they conflicting at all (guess) ?

"php /home/sheffiel/public_html/talknightlife.co.uk/cron.php 17" this is in my command box for the cron job, btw
Reply With Quote
  #6  
Old 04-20-2012, 01:09 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lukescotty View Post
this ID is the same too "17"

So i've created a new cron job "php /home/sheffiel/public_html/talknightlife.co.uk/cron.php 17" and it runs every 10 mins, but still no joy, do i need to remove the cronimage on the footer? are they conflicting at all (guess) ?
I don't see why they would conflict. You'd want to leave the cron image so that other tasks will run. BTW I believe you still need to set the task to run in the scheduled task manager.


Quote:
"php /home/sheffiel/public_html/talknightlife.co.uk/cron.php 17" this is in my command box for the cron job, btw
Yeah, I didn't know what the exact command would look like so I was hoping you would know what I meant.

Did you check the vb logs to see if anything's getting logged when your cron job runs?
Reply With Quote
  #7  
Old 04-20-2012, 01:21 PM
lukescotty lukescotty is offline
 
Join Date: Jul 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE=kh99;2321899]BTW I believe you still need to set the task to run in the scheduled task manager.QUOTE]

The box is checked in schedule task manager. ?? doesnt that mean its set to run ?

( aswell, even though I've set it on certain times ) when looking at the Next Time, it displays a time in the past, even though it should be operating a couple times an hour.
Reply With Quote
  #8  
Old 04-20-2012, 01:24 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lukescotty View Post
The box is checked in schedule task manager. ?? doesnt that mean its set to run ?
Yeah, just wanted to make sure that you didn't disable it or change the times it runs thinking that it wasn't needed if you called it from your cron job.

I seen other people mention that a job doesn't seem to run even if next time is in the past, and I really don't know why that is. I'll have a look at cron.php and see if I can think of anything.
Reply With Quote
  #9  
Old 04-20-2012, 01:38 PM
lukescotty lukescotty is offline
 
Join Date: Jul 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

much appreciated kh99, get back to us if u find anything which i could alter in the cron file to put this !pain in the arse! thing to rest.
Reply With Quote
  #10  
Old 04-20-2012, 01:57 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I think that didn't work because nothing anywhere in the rest of the vb code ever sets $vbulletin->options['crontab'] to true. I don't know why, maybe it's left over from an old version or some testing. (ETA: sorry, I forgot that you'd have to look at the code for cron.php to see what I mean). Anyway, you could try this: copy cron.php to another file, like maybe runrssposter.php. Then edit that file, and replace all the code including and after the 'cron_start' hook line with:

Code:
($hook = vBulletinHook::fetch_hook('cron_start')) ? eval($hook) : false;

$cronid = intval($_SERVER['argv'][1]);
// 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);
$db->close();

then change your cron job to run that file. Sorry, I'd just post the entire thing but posting entire vb files isn't allowed.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:19 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04207 seconds
  • Memory Usage 2,257KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete