Raised This Month: $12 Target: $400
 3% 

Server Clean Up (1.2.2)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Jamster
Veteran Member
Join Date: Jun 2008
Plugin ID:
1348
Plugin Version:
1.2.2
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    1330 
    Plugin Description:
    Automatically deletes logs, SM logs, sprays and automatic demo files that are more than x hours old.
    Old 12-20-2009 , 10:55   Server Clean Up (1.2.2)
    Reply With Quote #1

    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!)
    Attached Files
    File Type: cfg plugin.servercleanup.cfg (3.3 KB, 2636 views)
    File Type: sp Get Plugin or Get Source (servercleanup.sp - 4583 views - 16.1 KB)
    File Type: txt servercleanup.phrases.txt (3.0 KB, 2251 views)

    Last edited by Jamster; 03-22-2018 at 17:01. Reason: Updated post to reflect fixed version
    Jamster is offline
    zeroibis
    Veteran Member
    Join Date: Jun 2007
    Old 01-02-2010 , 11:20   Re: Server Clean Up
    Reply With Quote #2

    I will be testing this out
    __________________
    zeroibis is offline
    bouncer
    Veteran Member
    Join Date: Apr 2009
    Old 01-02-2010 , 18:10   Re: Server Clean Up
    Reply With Quote #3

    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.
    __________________


    bouncer is offline
    Jamster
    Veteran Member
    Join Date: Jun 2008
    Old 01-02-2010 , 19:28   Re: Server Clean Up
    Reply With Quote #4

    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 is offline
    Jamster
    Veteran Member
    Join Date: Jun 2008
    Old 01-24-2010 , 17:38   Re: Server Clean Up
    Reply With Quote #5

    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.
    Jamster is offline
    rambomst
    SourceMod Donor
    Join Date: Nov 2009
    Location: Sydney, Australia
    Old 01-24-2010 , 17:53   Re: Server Clean Up
    Reply With Quote #6

    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?
    __________________
    rambomst is offline
    Jamster
    Veteran Member
    Join Date: Jun 2008
    Old 01-24-2010 , 17:56   Re: Server Clean Up
    Reply With Quote #7

    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!
    Jamster is offline
    rambomst
    SourceMod Donor
    Join Date: Nov 2009
    Location: Sydney, Australia
    Old 01-24-2010 , 18:00   Re: Server Clean Up
    Reply With Quote #8

    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.
    __________________
    rambomst is offline
    Jamster
    Veteran Member
    Join Date: Jun 2008
    Old 01-24-2010 , 18:11   Re: Server Clean Up
    Reply With Quote #9

    Yeah, your average server is gonna have a ton of logs just for a few days even, hah.
    Jamster is offline
    saint555
    BANNED
    Join Date: Aug 2009
    Location: Hungary
    Old 01-25-2010 , 03:12   Re: Server Clean Up
    Reply With Quote #10

    Hi!
    This script clean up the ../cstrike/downloads map? (the sprays)
    Br.: saint
    saint555 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 02:07.


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