vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Move 'Hourly Cleanup' Scheduled Tasks, to cpanel cronjob (https://vborg.vbsupport.ru/showthread.php?t=275521)

basketmen 12-15-2011 11:49 AM

Move 'Hourly Cleanup' Scheduled Tasks, to cpanel cronjob
 
Hi guys, i want to Move 'Hourly Cleanup' Scheduled Tasks, to cpanel cronjob, so cleaning more constant and stable from server side, not from if someone load the cron image in the footer template



i created cronjob in cpanel, but its looks like not working

the command is
Quote:

php /home/username/public_html/includes/cron/cleanup.php


in the email notification, only get this
Quote:

X-Powered-By: PHP/5.2.17
Content-type: text/html



i already tried moving the cleanup.php file to the root (/home/username/public_html/cleanup.php) , but its looks like still not working




please help how to Move that Scheduled Tasks, to cpanel cronjob, really need to do it

kh99 12-15-2011 03:27 PM

I don't think you can call the cron/cleanup.php directly, it assumes that some things have been done already (like the database connection created, etc). I haven't tried it, but I think if I were doing that I would probably try making the cron command something like:

Code:

curl www.mydomain.com/cron.php

(assuming you have a linux server and the curl command is available, of course). Also of course you want to replace www.mydomain.com with the actual path to your forum.

Adrian Schneider 12-15-2011 03:40 PM

In your cron files, try adding the following to the top:

PHP Code:

error_reporting(E_ALL E_NOTICE 8192);

chdir('/path/to/vbulletin');
require(
'./global.php'); 

Be sure to either copy them elsewhere or disable the originals as this would otherwise break them.

kh99 12-15-2011 04:05 PM

Quote:

Originally Posted by Adrian Schneider (Post 2278034)
In your cron files, try adding the following to the top:

Cool, does that work? I've never tried running vb scripts from the command line. ETA: Seems like it does.

Adrian Schneider 12-15-2011 04:15 PM

I haven't tried it with cron jobs, but I have a ton of development tools which I use all from the command line. As long as you include global.php then you're good to go.


All times are GMT. The time now is 02:30 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.00991 seconds
  • Memory Usage 1,724KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete