vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Cron Job, really doing my head in, please help (https://vborg.vbsupport.ru/showthread.php?t=281825)

lukescotty 04-21-2012 12:04 AM

only just got in from work, gonna have to have alook at it tomorrow, thanks for the help so far!!

lukescotty 04-22-2012 08:11 PM

kh99, yo! just tried this, but unfortunately its not working, just wondering is it possible to copy this cron file, rename it, edit a part of the code, just to run rssposter?? or is it not fesible.

or.. could i have sum setting's messed up, and it could be work?

kh99 04-22-2012 08:17 PM

Quote:

Originally Posted by lukescotty (Post 2322564)
kh99, yo! just tried this, but unfortunately its not working, just wondering is it possible to copy this cron file, rename it, edit a part of the code, just to run rssposter?? or is it not fesible.

That's what I was trying to do - well, sort of. I guess it still needed a parameter. You could use this code (follow same instructions above)

Code:

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

exec_cron(17);
$db->close();


Sorry, I have no way to test this so I'm just kind of guessing right now.

lukescotty 04-23-2012 12:14 PM

Hiya, still no joy. I wonder if someone else on here could give try it out too, to see whether its me or the script.

Hmm, if i can't get it done, how could I get someone to write me a script or get futher help, even if i have to pay

regards lukescotty

kh99 04-23-2012 01:25 PM

Yes, if someone else has an idea please jump in.

I decided just to test it without an actual cron entry. I think I've changed this enough so I can post it, so here's the entire script I used:

Code:

<?php

error_reporting(E_ALL & ~E_NOTICE);
ignore_user_abort(1);
@set_time_limit(0);

define('SKIP_SESSIONCREATE', 1);
define('NOCOOKIES', 1);
define('THIS_SCRIPT', 'cron');

$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array('crondata');

require_once('./global.php');
require_once(DIR . '/includes/functions_cron.php');

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

exec_cron(17);

?>


I added an rss feed, removed the cronimage from my footer to make sure it couldn't run any other way, and I ran the above script via the broswer. It worked and posted the threads from the feed. I did notice that when I used cnn as the feed it posted the news stories once, then I couldn't get it to work again even after I removed the feed from the feed manager and reenetered it. It seemed like the feed was empty for some reason. I switched to another feed and that problem went away, but I thought I'd mention it because maybe some feeds work differently and it could be part of your problem.

Thing is, this is obviously not being run as a cron job, and it's also being run through the web server as a CGI request and not via command line. So I suppose it's possible that one of those things is causing your problem. But you could test that by running the above script in a web browser.

lukescotty 04-23-2012 03:25 PM

its becoming a bit of a headache this isnt it? I've saved the code above as a .php uploaded it to my server, created a cron job linking to that file.. but still no luck :( I've spoken to my host and they say everything is fine on the server side. I'm just thinking what I could do, i really want these feeds to auto post, otherwise i'm going to be constantly selecting "run now" every hour which i don't think i could do.

How about me giving you access to everything, on my vbulletin and my cpanel to see if you can see anything wrong?

Really appreiciate the time you've given me!

kh99 04-23-2012 03:28 PM

Did you try just pointing your browser at it and seeing what happens?

lukescotty 04-23-2012 05:30 PM

:: i've tried opening http://www.talknightlife.co.uk/runrssposter1.php in my browser, comes to a blank screen, am i doing this bit right

I've also wacked in more rss feeds, one from fox news, one from itv, one from sky news, to make sure its not twitter.

I must be doing something wrong here!! wheres the knife

kh99 04-23-2012 06:34 PM

Quote:

Originally Posted by lukescotty (Post 2322861)
:: i've tried opening http://www.talknightlife.co.uk/runrssposter1.php in my browser, comes to a blank screen, am i doing this bit right

Yeah, it should just be blank. But you're saying you didn't see any posts. Hmm... And when you go to the scheduled task manager you have it set to run every minute and the Next time is recent (or in the past even, I think you said)?

lukescotty 04-23-2012 06:43 PM

looking at the time you posted, all my twitter feeds updated at 21.35 which is a minute after u posted, soooo, by you clicking that php link has made it work ? do you mind clicking it again?

--------------- Added [DATE]1335213911[/DATE] at [TIME]1335213911[/TIME] ---------------

the cron is set to everyminute on CPanel, where as the times in VB Schedule task manager are set at different times of the hour 00, 04, 15, 31, 36, 58


All times are GMT. The time now is 11:12 PM.

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.01512 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete