Skip to content

Logfiles cleaning#688

Merged
dgibbs64 merged 11 commits intomasterfrom
logfiles-cleaning
Feb 10, 2016
Merged

Logfiles cleaning#688
dgibbs64 merged 11 commits intomasterfrom
logfiles-cleaning

Conversation

@UltimateByte
Copy link
Copy Markdown
Contributor

fixes #354

Took me some time to figure out how it was working, and to simplify it a little bit (with the exact same functionalities), but i think it's way cleaner that way.
Tested, working on one of my DarkRP.
I see no reason why it wouldn't work for sourcemod, as the folder path is right, and i triple checked the syntax.

Gamecount should target gamelogdir, not scriptlogdir, as it seems to be for retrocompatibility only, and according to this (line 44) :

	if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then
		find "${gamelogdir}"/ -type f -mtime +${logdays}|tee >> "${scriptlog}"
	fi
Why make it simple when you can make it harder !
> Removing conditional functions for additions, by setting all variables to 0 before starting counting.
> Removing "else, set to 0", as 0 is now the default state
Merging logging, counting, and removing logfiles in one place, to avoid some redundant if statements
Also, understanding the code and supporting new logs should be easier.

Adding srcds / sm / ulx / darkrp logs support
and removing useless check for creating folders variables
@UltimateByte
Copy link
Copy Markdown
Contributor Author

Confirm working with CSS, it took a while, lol... I never cleaned it before.

[ OK ] Log Manager css-server: Starting
[ INFO ] Log Manager css-server: Removing logs older than 7 days
[ OK ] Log Manager css-server: Removed 41382 log files

I also saw a /log/server folder, as my installation was pretty old. I'll make a function to clean those too.
Hopefully i can change the code after pull requesting.

@UltimateByte
Copy link
Copy Markdown
Contributor Author

Here it is, the old /log/server folder will be cleaned, and removed only if empty (means containling no log since ${logdays}.

dgibbs64 added a commit that referenced this pull request Feb 10, 2016
@dgibbs64 dgibbs64 merged commit 9f00e83 into master Feb 10, 2016
@dgibbs64 dgibbs64 deleted the logfiles-cleaning branch February 20, 2016 20:20
@dgibbs64 dgibbs64 restored the logfiles-cleaning branch February 21, 2016 21:48
@UltimateByte UltimateByte deleted the logfiles-cleaning branch March 1, 2016 07:55
@lock
Copy link
Copy Markdown

lock Bot commented Jul 19, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server logfile auto-delete (several GB after a few months)

2 participants