AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Server Clean Up (1.2.2) (https://forums.alliedmods.net/showthread.php?t=112651)

Jamster 12-20-2009 10:55

Server Clean Up (1.2.2)
 
28 Attachment(s)
Please see e54385991's post below (many thanks for fixing in my absence) for the fixed version, I no longer maintain this plugin.
https://forums.alliedmods.net/showpo...&postcount=190

About

A pretty simple plugin that does what it says, cleans up old logs, sprays and automatic demo files. It does this every map start.

Configuration

Configure the attached config and upload or edit the automatically generated config when you run the plugin. You can control how long to keep files of different types and whether to include archives for demo files. The default config WON'T delete anything until you set it up.

Installation

servercleanup.smx -> addons/sourcemod/plugins/
servercleanup.phrases.txt -> addons/sourcemod/translations/
plugin.servercleanup.cfg -> cfg/sourcemod/ (optional, automatically generated)

Translations

Hungarian (WARNING: NOW OUTDATED): http://forums.alliedmods.net/showpos...9&postcount=57 (thanks blue zebra!)

Support

Should work on any SM version, if you have any problems just post and give me any errors you get plus your config.

This plugin should be fine BUT I am not responsible for any loss of data or damage to your server that this plugin may or may not cause. Saying that though, I've tested it pretty thoroughly and it seems to be A-OK.

Thanks

I have to thank sslice for his plugin Spray Pruning to give a good idea of how to attack this plugin, so much thanks! I highly recommend using his plugin if spray cleaning is all you need.

Changes

1.0
- Initial public release.

1.1
- Added full translation support to convars.
- Added new cvar to control what type of logs to delete (normal logs, normal + error logs, all logs).
- Added a command to manually execute clean up "sm_srvcln_now" (set to root only).
- Added a convar to control whether server clean up automatically cleans up on map start or not (enabled by default).
- Detection code totally rewritten.

1.1.1
- Fixed a small memory leak.

1.1.2
- Added support to clean up sprays.

1.1.3
- Added cvar "sm_srvcln_demos_path" so users can point to an optional location to their demo files.
- Added proper directory detection.
- Fixed translation errors.

1.1.4
- Fixed issue if you installed the plugin on a fresh server it would complain about the downloads directory being missing.

1.1.5
- Removed warnings about directories, only confuses users.

1.1.6
- Fixed return on "clean now" command.
- Removed an old check for the spray folder.

1.1.7
- Added WarMod support.

1.1.8
- Added round backup clean up for csgo in default form.
- New minimum time of 12 hours is now allowed, also added a super clean mode for all time cvars using -1 which just keeps the current days files.
- Added a cvar to optionally log what gets deleted.

1.1.9
- Fixed round backup clean up for csgo to use the proper cvar for setting the round backup file name prefix, thanks SanKen!

1.2.0
- Added support for replay cleaning and steampipe spray cleaning.
- Added cvar to control whether to check for archives too when cleaning replays.

1.2.1
- Added a more thorough check on the round backup files to prevent the deletion of important text files in the case of the mp_backup_round_file being empty.

1.2.2
- Fixed memory leaks and optimised some code (thanks 11530!)

zeroibis 01-02-2010 11:20

Re: Server Clean Up
 
I will be testing this out:mrgreen:

bouncer 01-02-2010 18:10

Re: Server Clean Up
 
Will be testing this as well, this is something that should have been created a long time ago, rather more, should be a sourcemod settings by default!
Hopefully I wont forget to check if it actually works lol.

Jamster 01-02-2010 19:28

Re: Server Clean Up
 
Thanks guys.

btw, anyone that has their server archive their demos every day it will go by the date when the archive is created not the date of the demo itself. It makes sense from a file access point of view but "looking" at the dates in the filename it won't, of course, heh.

Jamster 01-24-2010 17:38

Re: Server Clean Up
 
Update posted.

1.1
- Added full translation support to convars.
- Added new cvar to control what type of logs to delete (normal logs, normal + error logs, all logs).
- Added a command to manually execute clean up "sm_srvcln_now" (set to root only).
- Added a convar to control whether server clean up automatically cleans up on map start or not (enabled by default).
- Detection code totally rewritten.

rambomst 01-24-2010 17:53

Re: Server Clean Up
 
I just tested it on SM 1.3.0 and MM 1.8.0 and it works wonders <3 I love this plugin. One question tho is this meant to delete logs out of /cstrike/logs/ folder?

Jamster 01-24-2010 17:56

Re: Server Clean Up
 
Well, depends on how you have it setup but yes, that's what it does.

It deletes logs from <game>/logs (or whatever sv_logsdir is set to) and <sourcemod>/logs

Also, thanks!

rambomst 01-24-2010 18:00

Re: Server Clean Up
 
Nvm I thought it wasn't deleting the logs out of cstrike/logs but I neglected to look at the dates of them there is just so many I thought they were a few weeks old but they aren't they aren't. Its doing its job.

Jamster 01-24-2010 18:11

Re: Server Clean Up
 
Yeah, your average server is gonna have a ton of logs just for a few days even, hah.

saint555 01-25-2010 03:12

Re: Server Clean Up
 
Hi!
This script clean up the ../cstrike/downloads map? (the sprays)
Br.: saint

Jamster 01-25-2010 10:10

Re: Server Clean Up
 
Nope, you can get Spray Pruning for that, though I can add it if people really want.

biship 01-25-2010 10:21

Re: Server Clean Up
 
wow I have 1252 files in /left4dead2/downloads
If they are not deleted, I'd like to del old ones, by age maybe?

Jamster 01-25-2010 12:34

Re: Server Clean Up
 
That's what Spray Pruning does! As I said in the OP.
edit: link: http://forums.alliedmods.net/showthread.php?p=560565

Jamster 03-14-2010 12:43

Re: Server Clean Up
 
Update released, fixes a small memory leak, forgot to close a handle, oh lol, so rookie.

bouncer 03-14-2010 13:48

Re: Server Clean Up
 
This should be default in SM.

Jamster 03-29-2010 22:35

Re: Server Clean Up (1.1.2)
 
Uploaded new version, I have added support to clean up sprays too from the downloads folder, thought I might as well make it all in one now.

edit: updating on a live server may cause errors, due to the way the translations work in SM since I translate the cvars, if this happens don't panic, either wait for your server to eventually restart and it'll continue normally or update when your server is off or SM is unloaded. If you have the latest SM version though I think this isn't an issue any more.

rambomst 04-11-2010 22:13

Re: Server Clean Up (1.1.2)
 
I have an addon which changes the dir where auto recorded demos are saved. It would be nice if you added a cvar which I can change to specify where the demos are saved to as the cstrike folder got to cluttered up with all the auto recorded demos so I needed to change the dir.

Jamster 04-11-2010 23:14

Re: Server Clean Up (1.1.2)
 
Can do duder, I'll code it up for the next version!

rambomst 04-11-2010 23:15

Re: Server Clean Up (1.1.2)
 
Awesome thanks!

Jamster 04-12-2010 13:50

Re: Server Clean Up (1.1.3)
 
Update posted! The cvar for the demo path is "sm_srvcln_demos_path". I added a few other fixes too.

Jamster 04-29-2010 12:37

Re: Server Clean Up (1.1.4)
 
Small update, no need to update if you're running fine, just fixes a small issue if you're installing a fresh server it'll create the downloads folder so the plugin doesn't complain about it not being there!

-M-Jon 05-04-2010 03:57

Re: Server Clean Up (1.1.4)
 
L 05/04/2010 - 02:20:57: Console detour tried to unhook command "sm_dump_admcache" but it wasn't found
L 05/04/2010 - 02:20:57: Console detour tried to unhook command "sm_dump_handles" but it wasn't found
L 05/04/2010 - 02:20:57: Console detour tried to unhook command "sm" but it wasn't found

I am running the latest version of sourcemod and I am running Linux (CentOS 5.4 Final).

I believe the problem is being caused by this plugin:
http://forums.alliedmods.net/showthread.php?p=527208

Is there anyway you can create some type of integration with it (maybe with a cvar option)? Thanks.

Jamster 05-04-2010 11:53

Re: Server Clean Up (1.1.4)
 
This plugin is purely for cleaning up things on the server, that's it I'm afraid. I'd post in that thread if it is really an issue with that plugin.

Bacardi 05-04-2010 13:06

Re: Server Clean Up (1.1.4)
 
Quote:

Originally Posted by -M-Jon (Post 1169943)
L 05/04/2010 - 02:20:57: Console detour tried to unhook command "sm_dump_admcache" but it wasn't found
L 05/04/2010 - 02:20:57: Console detour tried to unhook command "sm_dump_handles" but it wasn't found
L 05/04/2010 - 02:20:57: Console detour tried to unhook command "sm" but it wasn't found
...

If I remember right those logs create rcon_lock-plugin first time when server reboot/shutdown/quit.
Ingore them.

*edit
Yep I guess right
#343

chu1720 05-12-2010 05:29

Re: Server Clean Up (1.1.4)
 
i am running my server in Win7 and i have got the following:

L 05/12/2010 - 17:25:43: [servercleanup.smx] Unable to open the server logs directory.

Jamster 05-12-2010 11:23

Re: Server Clean Up (1.1.4)
 
Does the logs directory exist? Did that error not appear any more when the server changed the map?

chu1720 05-12-2010 11:42

Re: Server Clean Up (1.1.4)
 
Quote:

Originally Posted by Jamster (Post 1178290)
Does the logs directory exist? Did that error not appear any more when the server changed the map?

The logs directory is Left 4 Dead 2\left4dead2\addons\sourcemod\logs, right?
If so, it does exist.

And this problem appears everytime when the server changed the map.

Bacardi 05-12-2010 12:41

Re: Server Clean Up (1.1.4)
 
Quote:

Originally Posted by chu1720 (Post 1178301)
The logs directory is Left 4 Dead 2\left4dead2\addons\sourcemod\logs, right?
If so, it does exist.

And this problem appears everytime when the server changed the map.

Have you srcds own log -folder ??
Code:

...Left 4 Dead 2\left4dead2\logs
It appears if you add in ...cfg/autoexec.cfg command "log on"
Or create empty folder. Ingore error

Jamster 05-12-2010 13:21

Re: Server Clean Up (1.1.4)
 
Or set the cvar to check for logs to 0 if you don't have logging on!

Jamster 06-14-2010 09:16

Re: Server Clean Up (1.1.5)
 
Tiny update, just removed the warnings about the directories, if they're not there it's because the server operator just doesn't use that particular function on the server (be it sprays, logs, sm logs etc). Will confuse new users less now.

tcviper 06-15-2010 04:58

Re: Server Clean Up (1.1.5)
 
Now this is the kind of plugins that is extremely usefull, thank you!

Jamster 06-15-2010 11:11

Re: Server Clean Up (1.1.5)
 
Thank you! It is my pleasure! >:3

RasterMan 06-15-2010 12:25

Re: Server Clean Up (1.1.5)
 
Whats the chances of getting this ported for amxx?

Jamster 06-15-2010 13:21

Re: Server Clean Up (1.1.5)
 
Er, I can have a go if you want though I can't promise anything, shouldn't be too hard I don't think, never coded for AMXX but it's not too different, right?

Jamster 06-16-2010 16:57

Re: Server Clean Up (1.1.6)
 
Small update, just makes performance only 0.00000001ms faster. :p

Also, I am starting to port this to AMXX now, seems easy enough. Might be a bit though (as in, a week, maybe, with my schedule as it is), I want to make sure I get it 100% correct before releasing it on AMXX.

Jamster 06-17-2010 16:23

Re: Server Clean Up (1.1.6)
 
News on the AMXX version. I may have to do some real programming. D:

Seems there is no way to get a file timestamp natively in AMXX, I am hoping I can somehow do it without needing to write my own module too but we shall see.

i.e. you will see the AMXX version whenever the hell I figure out how to do this! Other than that though the rest of the plugin is pretty much coded, lol.

RasterMan 06-18-2010 02:40

Re: Server Clean Up (1.1.6)
 
I look forward to an xmxx version as your SM version should be added to the default SM package :)

This is I must say one of the most useful plugins that I have ever used!

Jamster 06-18-2010 11:17

Re: Server Clean Up (1.1.6)
 
Thanks!

Lob (UK 06-24-2010 15:43

Re: Server Clean Up (1.1.6)
 
Superb Plugin :wink:

A must have for all Server Owners this i would say.

Thanks very much. :)

- Lob (UK)

RasterMan 08-15-2010 05:33

Re: Server Clean Up (1.1.6)
 
Any more news on the Amxx version?


All times are GMT -4. The time now is 10:29.

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