Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Template Shares (http://www.bvlist.com/forumdisplay.php?f=26)
-   -   Autoclean (cronjob) (http://www.bvlist.com/showthread.php?t=1542)

arejas 10th December 2008 18:56

Autoclean (cronjob)
 
Hi i am using TS 5.1 and i have little problem for me dont work cleanup (autocronjob) when i doclean manual it;s ok working but i setup in setings do cronjob every 1 hour but it's not working. Can any one help?


Sry for bad english.

Ashur 10th December 2008 19:45

maybe ur server doesn't support cronjob! (not sure for that answer so look it up on google) also check in clean setting if time set too high

arejas 10th December 2008 19:50

Quote:

Originally Posted by Ashur (Post 7322)
maybe ur server doesn't support cronjob! (not sure for that answer so look it up on google) also check in clean setting if time set too high

Ok i check google time in setings ok i set 1 hour.



Thanks just i need add crontab :) its now workink :)

skygate 1st February 2009 03:05

Quote:

Originally Posted by arejas (Post 7323)
Ok i check google time in setings ok i set 1 hour.



Thanks just i need add crontab :) its now workink :)


... not sure what you did to 'fix' your problem ... where did you 'add' the crontab??

... but just wanted to let everyone know that the CRONJOB as defined and used in TS SE v5.x has nothing to do with the UNIX server's cronjobs ...

... unfortunately the original coder of TS SE v5.x decided to use the name 'cronjob' which really relates to the UNIX server cron functions ...

... the code in TS SE v5.x does not untilize the UNIX cron functions on your server - so setting a real cronjob to 'run' cleanup code on your server IS NOT the way to do things ...

The TS SE v5.x 'cron' code is based on a function called ts_cron.php ... which is the pseudeo 'cronjob' system on TS SE v5.x ...

... here is a simple overview of how the 'cronjob' function works on TS SE v5.x ...

1. a flag is defined to set the cronjob to be 'on' or 'off'

2. the way the pseudo cronjob is started is by including a bit of code in a function which is ALWAYS called almost continously in an active tracker ... so be virtue of this fact the system constantly 'runs' the task via a function called dbconn () which is inside the ts_functions.php ...

3. there are several parameters ... 'RUN_CRONJOBS' and 'SKIP_CRON_JOBS' which are defined on specific pages ... so as to control wether or not the 'job' will execute ...
... there is also a parameter called $activeautomaticclean and this is set by default inside the function dbconn() as 'false' by default ... so unless when dbconn() is called with the dbconn (true, ???, ???); the automatic cleanup which you wanted to run will not execute ...

4. the pesudo cron function code in TS SE v5.x has been 'lifted' from vBulletin 'cronjob' - so if you want to know exactly how this works ... try our friend 'google' ... there is bound to be lots of 'how it works' posts on this ... as vBulletins is not encoded and well supported by the community - even though its a commercial product (perhaps same could happen with TS SE code - if the author was not blatenly 'lifting' code from others and claiming rights to ir ;) )

5. here is a little explanation of the coding used in TS SE v5.x ... some of the functions and specific parametes you should be noting ...


... in ts_functions.php ...

function dbconn ($activeautomaticclean = false, $checkuseraccount = true, $updateuseracc = true)

... further in the dbconn() function you will see ...


unset ($_SESSION[ts_cron_image]);
$_SESSION['ts_cron_image'] = '';
if (($activeautomaticclean AND !defined ('SKIP_CRON_JOBS')))
{
$_SESSION['ts_cron_image'] = '';
}

... above we can see that the code is checking if $activeautomaticclean is 'true' - if not it will NOT run the pseudo cron function ...

BUT if we look at the dbconn() function defenition above ... we see that the default value for $activeautomaticclean is 'false' ... so it must be SET to TRUE somwhere for the cron and specifically - cleanup code to run ...


... in ts_cron.php ...

dbconn (false, false, false);
require INC_PATH . '/readconfig_cleanup.php';
require INC_PATH . '/function_log_user_deletion.php';
if (((!cronjobs () AND !defined ('RUN_CRONJOBS')) AND !$_GET['run_cronjobs']))
{c
exit ();
}

6. not sure if the autocleanup 'logic' in all of the above code works - if is is set correctly - then it should work fine ...

Perhaps someone who has a 'WORKING' autocleanup system can make some comments and check their code - just in case there are some bugs in the release code of v5.1


... anyway ... the main point I would like to draw everyones attention to is that the CRONJOB function in TS SE v5.x has nothing to do with the UNIX server cronjob function ... and you should NOT be using the UNIX server cronjob function to run your autocleanup code ...

If you do have a working 'autocleanup' v5.1 system ... perhaps you could share the working code with everyone ... my copy was from mrdecoder (v5.1 decoded) which is (when I tested it after a few tweeks and settings) working 100% ... although I did not 'run' the system so never bothered to check the autoclean function ...

... I do believe that it does NOT work in its default setup - so Karma points allocation and other 'clean' functions will not work ...

Hope the above information is helpful to someone ...


Cheers


All times are GMT +2. The time now is 15:45.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.