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

TOGs File Cleaner


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Plugin ID:
4108
Plugin Version:
4.3
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    29 
    Plugin Description:
    Performs file actions for logs of a desired extension, filenames, and age at specified paths
    Old 02-26-2014 , 03:11   TOGs File Cleaner
    Reply With Quote #1

    Description
    This plugin allows users to create as many setups as desired for managing servers files. When each setup is run, the plugin searches in the path set and determines if each file within the path matches the criteria set by the user in the .txt file. The .txt file can contain as few or as many setups as desired. For matching files, the specified action is then taken (either delete, move, or copy...there are plans for more in the future).

    Download Package
    Github Repository (Source Code)


    See Github repository for plugin details and instructions.
    __________________

    Last edited by ThatOneGuy; 07-21-2017 at 16:43. Reason: Moved to Github
    ThatOneGuy is offline
    ThatOneGuy
    Veteran Member
    Join Date: Jul 2012
    Location: Oregon, USA
    Old 02-26-2014 , 03:18   Re: File Cleaner (v2.0)
    Reply With Quote #2

    -reserved-
    ThatOneGuy is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 02-26-2014 , 03:54   Re: File Cleaner (v2.0)
    Reply With Quote #3

    Perhaps an optional key that specifies the starting location of the desired string. For example, the logs start with a capitol L, right?

    Code:
    "SM Main Logs"
    	{
    		"enabled"		"0"
    		"filepath"		"logs"
    		"days"			"3"
    		"string"		"L"
    		"start"			"0"
    		"case"			"1"
    		"extension"		".log"
    		"exclude"		"Chat"
    	}
    You'd just need to compare the return of the StrContains on line 177 with this value here. This will help to ensure that the wrong files aren't accidentally deleted (like if you accidentally made it case insensitive, for example.)

    To clarify, if the string that StrContains was looking for is found at the VERY beginning of the bigger string, then the function will return 0. If it begins at the second character, it will return 1. Third character will return 2. Etc.
    __________________

    Last edited by ddhoward; 02-26-2014 at 03:56.
    ddhoward is offline
    ThatOneGuy
    Veteran Member
    Join Date: Jul 2012
    Location: Oregon, USA
    Old 03-30-2014 , 01:57   Re: File Cleaner (v2.0)
    Reply With Quote #4

    Quote:
    Originally Posted by ddhoward View Post
    Perhaps an optional key that specifies the starting location of the desired string. For example, the logs start with a capitol L, right?

    Code:
    "SM Main Logs"
    	{
    		"enabled"		"0"
    		"filepath"		"logs"
    		"days"			"3"
    		"string"		"L"
    		"start"			"0"
    		"case"			"1"
    		"extension"		".log"
    		"exclude"		"Chat"
    	}
    You'd just need to compare the return of the StrContains on line 177 with this value here. This will help to ensure that the wrong files aren't accidentally deleted (like if you accidentally made it case insensitive, for example.)

    To clarify, if the string that StrContains was looking for is found at the VERY beginning of the bigger string, then the function will return 0. If it begins at the second character, it will return 1. Third character will return 2. Etc.
    I may implement this in a future version. However, I will adjust the numbers so first char is 1, second=2, etc., blank=anywhere
    ThatOneGuy is offline
    ThatOneGuy
    Veteran Member
    Join Date: Jul 2012
    Location: Oregon, USA
    Old 05-28-2014 , 18:38   Re: TOGs File Cleaner (v3.0)
    Reply With Quote #5

    Plugin updated to version 3.0.

    Now supports searching within root directory.
    ThatOneGuy is offline
    ThatOneGuy
    Veteran Member
    Join Date: Jul 2012
    Location: Oregon, USA
    Old 08-29-2015 , 02:00   Re: TOGs File Cleaner
    Reply With Quote #6

    Updated upon request to version 4.2. See changelog for changes.
    __________________
    ThatOneGuy is offline
    itiap
    BANNED
    Join Date: Nov 2015
    Old 12-17-2015 , 09:43   Re: TOGs File Cleaner
    Reply With Quote #7

    I have an SM error log.
    I used the smx attached on your first post.
    Code:
    L 12/17/2015 - 15:42:11: [SM] Displaying call stack trace for plugin "togfilecleaner.smx":
    L 12/17/2015 - 15:42:11: [SM]   [0]  Line 451, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::RunSetups()
    L 12/17/2015 - 15:42:11: [SM]   [1]  Line 55, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::OnMapStart()

    Last edited by itiap; 12-17-2015 at 10:03.
    itiap is offline
    Send a message via AIM to itiap Send a message via Yahoo to itiap Send a message via Skype™ to itiap
    ThatOneGuy
    Veteran Member
    Join Date: Jul 2012
    Location: Oregon, USA
    Old 12-17-2015 , 12:31   Re: TOGs File Cleaner
    Reply With Quote #8

    Quote:
    Originally Posted by itiap View Post
    I have an SM error log.
    I used the smx attached on your first post.
    Code:
    L 12/17/2015 - 15:42:11: [SM] Displaying call stack trace for plugin "togfilecleaner.smx":
    L 12/17/2015 - 15:42:11: [SM]   [0]  Line 451, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::RunSetups()
    L 12/17/2015 - 15:42:11: [SM]   [1]  Line 55, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::OnMapStart()
    Is there more to the log? Can you paste your config somewhere? I'm seeing line 451 as:
    Code:
    if(DirExists(sRootFilePath) || StrEqual(sRootFilePath, "", false))
    I dont see this line erroring out, so I'm guessing the lines arent the same (likely due to deleting comments at the top). My guess is that there is an error in your config. Upload it and i'll take a look. Also, paste in the error log around the above...it seems like there may be a line missing (perhaps not).
    __________________
    ThatOneGuy is offline
    itiap
    BANNED
    Join Date: Nov 2015
    Old 12-17-2015 , 18:23   Re: TOGs File Cleaner
    Reply With Quote #9

    I use the default one. I just disable what i dont need.

    Code:
    L 12/17/2015 - 15:42:11: [SM] Native "DirExists" reported: Invalid path. An empty path string is not valid, use "." to refer to the current working directory.
    L 12/17/2015 - 15:42:11: [SM] Displaying call stack trace for plugin "togfilecleaner.smx":
    L 12/17/2015 - 15:42:11: [SM]   [0]  Line 451, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::RunSetups()
    L 12/17/2015 - 15:42:11: [SM]   [1]  Line 55, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::OnMapStart()
    I don't know if you use a code like that. Franciso make a reply about that.
    https://forums.alliedmods.net/showthread.php?p=2330328
    togfilecleaner.txt

    Last edited by itiap; 12-17-2015 at 18:25.
    itiap is offline
    Send a message via AIM to itiap Send a message via Yahoo to itiap Send a message via Skype™ to itiap
    ThatOneGuy
    Veteran Member
    Join Date: Jul 2012
    Location: Oregon, USA
    Old 12-18-2015 , 00:08   Re: TOGs File Cleaner
    Reply With Quote #10

    Quote:
    Originally Posted by itiap View Post
    I use the default one. I just disable what i dont need.

    Code:
    L 12/17/2015 - 15:42:11: [SM] Native "DirExists" reported: Invalid path. An empty path string is not valid, use "." to refer to the current working directory.
    L 12/17/2015 - 15:42:11: [SM] Displaying call stack trace for plugin "togfilecleaner.smx":
    L 12/17/2015 - 15:42:11: [SM]   [0]  Line 451, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::RunSetups()
    L 12/17/2015 - 15:42:11: [SM]   [1]  Line 55, C:\Users\Daniel\Downloads\CSS\Server Builds\SM\addons\sourcemod\scripting\scripting1_7\togfilecleaner.sp::OnMapStart()
    I don't know if you use a code like that. Franciso make a reply about that.
    https://forums.alliedmods.net/showthread.php?p=2330328
    Weird, it always worked perfect on my CSS servers. Just read on that other thread that some guy said the same and that it is a csgo file system issue. Either way, I'll make some edits.

    EDIT: Have you tried putting a . in for filepath? Perhaps that is a simple fix on the config side that users can do...my worry is that i add the "." when it is detected blank and that that might cause it not to work properly for other games. I dont have much of a way to test from the computer I'm at right now, though I may just end up coding in csgo detection and doing it in that case for the root setups.
    __________________

    Last edited by ThatOneGuy; 12-18-2015 at 00:36.
    ThatOneGuy 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 08:00.


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