Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > Template Shares
Reply
  #1  
Old 10-12-08, 18:56
arejas's Avatar
arejas arejas is offline
Senior Member
 
Join Date: Jun 2008
Lithuania
Posts: 23
Default 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.
Reply With Quote
  #2  
Old 10-12-08, 19:45
Ashur's Avatar
Ashur Ashur is offline
Moderator
 
Join Date: Jun 2008
Posts: 523
Default
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
__________________
Say NO to private tracking
Running TorrentHoster 2.5 on IraqiGate.org
Reply With Quote
The Following User Says Thank You to Ashur For This Useful Post:
arejas (10-12-08)
  #3  
Old 10-12-08, 19:50
arejas's Avatar
arejas arejas is offline
Senior Member
 
Join Date: Jun 2008
Lithuania
Posts: 23
Default
Quote:
Originally Posted by Ashur View Post
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 :)

Last edited by arejas; 10-12-08 at 23:46.
Reply With Quote
  #4  
Old 01-02-09, 03:05
skygate's Avatar
skygate skygate is offline
VIP
 
Join Date: Jul 2008
Posts: 12
Exclamation
Quote:
Originally Posted by arejas View Post
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'] = '<img src="' . $BASEURL . '/ts_cron.php?rand=' . time () . '" alt="" title="" width="1" height="1" border="0" />';
}

... 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
Reply With Quote
Reply

Tags
autoclean , cronjob

Thread Tools

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 +2. The time now is 12:01. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2019, vBulletin Solutions Inc.