Raised This Month: $32 Target: $400
 8% 

Server Clean Up (1.2.2)


Post New Thread Reply   
 
Thread Tools Display Modes
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-19-2017 , 12:14   Re: Server Clean Up (1.2.2)
Reply With Quote #201

Quote:
Originally Posted by Obyboby View Post
I did (of course I did, please don't take me as a noob who just wants things fixed without moving a finger ) but I don't get the meaning of it.
But I'll try again
https://forums.alliedmods.net/showpo...&postcount=180

you can start by reading from there
__________________
8guawong is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 12-19-2017 , 12:16   Re: Server Clean Up (1.2.2)
Reply With Quote #202

Quote:
Originally Posted by 8guawong View Post
https://forums.alliedmods.net/showpo...&postcount=180

you can start by reading from there
Thanks, will do once I'm home from work.


EDIT:
I'm really sorry, I totally missed that this error was already mentioned.
Will read the thread and find a fix in the previous posts. Thanks again

OK found it, sorry again for being a noob and not reading :C

Quote:
Originally Posted by e54385991 View Post
fixed error

require sourcemod v1.7+ to compile
__________________

Last edited by Obyboby; 12-19-2017 at 17:21.
Obyboby is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 02-22-2018 , 09:05   Re: Server Clean Up (1.2.2)
Reply With Quote #203

Hello, is there a way to set a clean up frequency of like 1 or 2 hours? I really need to save demos but I want them to be stored for like an hour or so.
How do I edit the source?
Thanks for any help

The minimum amount of hours possible as of now is 12, I just need to edit the source to make it 1 instead of 12. Should be ez right?

I also need some help with the demos deletion:

My GOTV is saving them into /csgo/.
Is that the default folder? Do I need to specify it in the CFG? If yes, what do I write there? /server/csgo/ or /csgo/ or / ?
__________________

Last edited by Obyboby; 02-22-2018 at 12:48.
Obyboby is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 03-13-2018 , 13:20   Re: Server Clean Up (1.2.2)
Reply With Quote #204

Quote:
Originally Posted by Obyboby View Post
Hello, is there a way to set a clean up frequency of like 1 or 2 hours? I really need to save demos but I want them to be stored for like an hour or so.
How do I edit the source?
Thanks for any help

The minimum amount of hours possible as of now is 12, I just need to edit the source to make it 1 instead of 12. Should be ez right?

I also need some help with the demos deletion:

My GOTV is saving them into /csgo/.
Is that the default folder? Do I need to specify it in the CFG? If yes, what do I write there? /server/csgo/ or /csgo/ or / ?

Could someone please confirm the part in bold..?

Console output:

PHP Code:
"sm_srvcln_demos_path" "./" def"./demos" )                                 - Optional directory path to your demo files if you are manually saving them elsew
L 03
/13/2018 18:19:20rcon from "xxxxxx"command "sm_srvcln_demos_path" 
The demos are not being deleted so I guess it's either the wrong folder or the change I've made to the source code does not work. (I tried to reduce the minimum clean up frequency to one hour because I can't keep demos for 12 hours, it would fill the server space).

Hopefully someone is willing to help me out

EDIT:

Read the whole thread for the second time and found the answer:

Quote:
Originally Posted by Sketchy View Post
Can you gimme an example of what sm_srvcln_demos_path should be if i want to clean up sourcetv demo files that are being saved at ../cstrike/addons/sourcemod/recordings/ (and on GO ../csgo/addons/sourcemod/recordings/) cause I cant seem to get that 1 setting correct.
Quote:
Originally Posted by Jamster View Post
oh, it's without the game folder so e.g. /addons/sourcemod/recordings/

That means that the workaround I've tried in order to reduce the minimum demos clean up frequency to 1 instead of 12, didn't work.

Basically I was trying to remove the 12 hours check in order to trick the plugin and allow me to set a frequency of one hour to clean demos.

The old lines of code:
PHP Code:
{    
    
int Time32;
    
int TimeType GetConVarInt(cvar_time[type]);
    if (
TimeType != -1)
    {
        if (
TimeType <= 1)
        {
            
Time32 GetTime() / 3600 1;
            
TimeType 1;
        }
        else
        {
            
Time32 GetTime() / 3600 TimeType;
        }
    } 
New lines of code:

PHP Code:
{    
    
int Time32;
    
int TimeType GetConVarInt(cvar_time[type]);
    if (
TimeType != -1)
    {
            
Time32 GetTime() / 3600 TimeType;
    } 

I'm pretty noob at coding and asked a friend for some help and he suggested that, but we weren't sure it would help.
Some input would be greatly appreciated <3


EDIT2:

I decided to revert the plugin to the last known working version which should be this one because I began to suspect that it wasn't deleting the demos regardless, I mean, it looks like it's not deleting them at all.
I have now installed another plugin that allowed me to set a custom folder for the recorded demos, so I was able to set "./demos" as the GOTV default folder.
I then reverted the setting for Server clean up to make it point to the same directory to clean up demos.
The CFG is as follows:

PHP Code:
// This file was auto-generated by SourceMod (v1.8.0.6041)
// ConVars for plugin "servercleanup.smx"


// Clean up automatically recorded demo files.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_demos "1"

// Include archives when deleting old demos (if your server automatically compresses them, detects: bz2, zip, rar and 7z).
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_demos_archives "1"

// Optional directory path to your demo files if you are manually saving them elsewhere.
// -
// Default: "./demos"
sm_srvcln_demos_path "./demos"

// Time (in hours) to keep demo files (default is one week, minimum value is 12 hours, set to -1 to keep current day only).
// -
// Default: "168"
// Minimum: "-1.000000"
sm_srvcln_demos_time "12"

// Enable automatic server clean up (1 - enable, 0 - disable, manual clean up command only).
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_enable "1"

// Log what Server Clean Up deletes.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_logging_mode "1"

// Clean up regular server logs.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_logs "1"

// Time (in hours) to keep regular server logs (default is one week, minimum value is 12 hours, set to -1 to keep current day only).
// -
// Default: "168"
// Minimum: "-1.000000"
sm_srvcln_logs_time "48"

// Clean up generated replay files.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_replays "1"

// Include archives when deleting old replays (if your server automatically compresses them, detects: bz2, zip, rar and 7z).
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_replays_archives "1"

// Time (in hours) to keep generated replay files (default is one week, minimum value is 12 hours, set to -1 to keep current day only).
// -
// Default: "168"
// Minimum: "-1.000000"
sm_srvcln_replays_time "48"

// Clean up CS:GO round backup files (note: only if none of the naming options have been changed from default settings for round backups).
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_roundbackups "1"

// Time (in hours) to keep round backup's in CS:GO (default is one week, minimum value is 12 hours, set to -1 to keep current day only).
// -
// Default: "168"
// Minimum: "-1.000000"
sm_srvcln_roundbackups_time "48"

// Clean up SourceMod server logs.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_smlogs "1"

// Time (in hours) to keep SourceMod server logs (default is one week, minimum value is 12 hours, set to -1 to keep current day only).
// -
// Default: "168"
// Minimum: "-1.000000"
sm_srvcln_smlogs_time "48"

// What type of logs to delete from the SM logs folder (0 - just normal logs, 1 - normal logs and error logs, 2 - all logs).
// -
// Default: "2"
// Minimum: "0.000000"
// Maximum: "2.000000"
sm_srvcln_smlogs_type "2"

// Clean up uploaded sprays.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_srvcln_sprays "1"

// Time (in hours) to keep uploaded sprays (default is one week, minimum value is 12 hours, set to -1 to keep current day only).
// -
// Default: "168"
// Minimum: "-1.000000"
sm_srvcln_sprays_time "48" 
Does the "sm_srvcln_now" command delete demos as well, or just logs?
Since the minimum cleanup frequency for the demos is now 12 hours again, I can't really wait 12 hours and fill my server with demos before I can see if it actually works. So I was hoping the manual clean up deleted demos as well but it didn't really work.. Unless i got it wrong and the manual command still follows the frequency rule set in the CFG?
I thought it would override the time settings and just clean everything in the various folders..
__________________

Last edited by Obyboby; 03-22-2018 at 02:50.
Obyboby is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 03-20-2018 , 02:15   Re: Server Clean Up (1.2.2)
Reply With Quote #205

Eventually gave up and set 12 hours as demo clean up frequency, but it still doesn't seem to be working every time.
I just checked the server and I have demos that were created yesterday at 2.38 PM, and it's now 7.15 AM here, that's well over 12 hours. :/
Some other times everything works fine. I checked the folder permissions and it seems to be okay (xxx on the folder and 664 on the files)
I would love to get some help here ç_ç

EDIT: as soon as I posted I realized what could be the reason. The server was empty BEFORE the clean up time was reached, so the map hasn't changed since, therefore the clean up hasn't been performed yet.

EDIT2: manually changing maps didn't trigger the cleaning though. I had to run sm_srvcln_now in order to get rid of the old demos

Still looking for a way to reduce the minimum frequency to as low as one hour because every demo I record takes 5-600 MB of space and I can't afford keeping more than 3-4 demos saved at once. 12 hours of demos means around 7 GB :C
__________________

Last edited by Obyboby; 03-20-2018 at 02:21.
Obyboby is offline
Jamster
Veteran Member
Join Date: Jun 2008
Old 03-21-2018 , 06:47   Re: Server Clean Up (1.2.2)
Reply With Quote #206

You know, it's weird, I thought about all my old SourceMod plugins recently and what do you know, someone needs help, lmao, as you can tell I don't do any of this any more but good news, I can help you even though I am supremely Gandalfing on all the code to my plugins. Huge thanks to e54385991 for fixing my broken piece of crap coding too from way back when.

Anyway, I can see my old ass self did this to check that the cvar was no lower than 12 and then set it to 12 (at around line 220):
Code:
if (TimeType < 12)
{
	Time32 = GetTime() / 3600 - 12;
	TimeType = 12;
}
else
{
	Time32 = GetTime() / 3600 - TimeType;
}
So, if you want no limits in place just change that so it reads:
Code:
Time32 = GetTime() / 3600 - TimeType;
Recompile it and you should be good for setting the cvar to whatever you want e.g. 1 hour.
Jamster is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 03-22-2018 , 02:38   Re: Server Clean Up (1.2.2)
Reply With Quote #207

Quote:
Originally Posted by Jamster View Post
You know, it's weird, I thought about all my old SourceMod plugins recently and what do you know, someone needs help, lmao, as you can tell I don't do any of this any more but good news, I can help you even though I am supremely Gandalfing on all the code to my plugins. Huge thanks to e54385991 for fixing my broken piece of crap coding too from way back when.

Anyway, I can see my old ass self did this to check that the cvar was no lower than 12 and then set it to 12 (at around line 220):
Code:
if (TimeType < 12)
{
	Time32 = GetTime() / 3600 - 12;
	TimeType = 12;
}
else
{
	Time32 = GetTime() / 3600 - TimeType;
}
So, if you want no limits in place just change that so it reads:
Code:
Time32 = GetTime() / 3600 - TimeType;
Recompile it and you should be good for setting the cvar to whatever you want e.g. 1 hour.
OMG!!!!!!!!
When I saw a reply to this thread I thought, oh, nice, someone decided to help me.. but when I read that it was the plugin developer himself, I was.. WHOA!!!!!!!
And yeah it's funny because I was reading your last comments here and they were so old, I was like, omg this guy will never be back to help ç_ç
Thanks for replying!!! Much appreciated!

So it seems that what my dev friend told me was the correct approach, simply remove the 12 hours check. I gotta check the two pieces of code to see if we had chosen the right part to replace though.. because it didn't seem to work. Uhm. I was also having trouble setting the directory though, so it might have been something else. Glad to see we were going the right direction tho xD
I will be testing this out today as soon as I'm home!

EDIT: yeah so I went through my previous post and what you told me to do is exactly what we tried pretty sure I still had the directory set wrong so the plugin wasn't deleting the demos just because it couldn't find em :p anyway I recompiled it and loaded - we'll see in a few hours if it works (but pretty sure it will)
Cheers

EDIT2: I'm attaching the modified .sp to this post for anyone who needs the same thing as I did
It's the latest working source code including e54385991's fix, the 12 hours minimum frequency check was removed in order to allow setting lower cleaning frequency (I'm setting 2 hours for the demo cleaning up for example)
Attached Files
File Type: sp Get Plugin or Get Source (servercleanup.sp - 561 views - 16.5 KB)
__________________

Last edited by Obyboby; 03-22-2018 at 03:14.
Obyboby is offline
Jamster
Veteran Member
Join Date: Jun 2008
Old 03-22-2018 , 16:56   Re: Server Clean Up (1.2.2)
Reply With Quote #208

Oh, your friend was right, yep, lmao, I didn't even read the post fully, but glad you got it working.
Jamster is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 03-22-2018 , 18:44   Re: Server Clean Up (1.2.2)
Reply With Quote #209

Quote:
Originally Posted by Jamster View Post
Oh, your friend was right, yep, lmao, I didn't even read the post fully, but glad you got it working.
Haha!
It works indeed.
Thanks for the plugin! Awesome!
__________________
Obyboby is offline
teran
Junior Member
Join Date: Oct 2017
Old 08-22-2018 , 06:21   Re: Server Clean Up (1.2.2)
Reply With Quote #210

It doesn't delete any logs in folders like: logs/materialadmin/ and other. It deletes files only in the main folder logs/. How can I make it delete EVERY log?

Last edited by teran; 08-23-2018 at 19:48.
teran is offline
Reply


Thread Tools
Display Modes

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 -4. The time now is 01:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode