[GH-ISSUE #4751] [Bug]: rustserver-game.log is not getting rotated #2949

Open
opened 2026-02-27 03:06:28 +03:00 by kerem · 1 comment
Owner

Originally created by @wrecktify on GitHub (Jan 19, 2025).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4751

User story

As a server owner, I want the log files to rotate, just like the console & script folders so that I can access previous logs and it doesnt get overwritten.

Game

Rust

Linux distro

Ubuntu 24.04

Command

command: start

Further information

On a fresh server install, there is only rustserver-game.log. Every time the server restarts, it just overwrites this file, and does not produce a rotating log.

Someone in LGSM support showed this line of code, which shows only unreal2 will rotate log files.

Image

Relevant log output

None, it is just the  rustserver-game.log being overwritten anytime.  If you need more log output please let me know.

Steps to reproduce

Install Rust server
Start server
Stop Server
Start server

There will always be only 1 rustserver-game.log file and it never rotates.

Originally created by @wrecktify on GitHub (Jan 19, 2025). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4751 ### User story As a server owner, I want the log files to rotate, just like the console & script folders so that I can access previous logs and it doesnt get overwritten. ### Game Rust ### Linux distro Ubuntu 24.04 ### Command command: start ### Further information On a fresh server install, there is only rustserver-game.log. Every time the server restarts, it just overwrites this file, and does not produce a rotating log. Someone in LGSM support showed this line of code, which shows only unreal2 will rotate log files. ![Image](https://github.com/user-attachments/assets/6c78a53f-8c8e-4df7-8bae-f41702492db3) ### Relevant log output ```shell None, it is just the rustserver-game.log being overwritten anytime. If you need more log output please let me know. ``` ### Steps to reproduce Install Rust server Start server Stop Server Start server There will always be only 1 rustserver-game.log file and it never rotates.
Author
Owner

@wrecktify commented on GitHub (Jan 19, 2025):

I updated the script manually to:

        # Log rotation.
        fn_script_log_info "Rotating log files"
        if [ "${engine}" == "unreal2" ] && [ -f "${gamelog}" ]; then
            mv "${gamelog}" "${gamelogdate}"
        elif [ "${engine}" == "unity3d" ] && [ -f "${gamelog}" ]; then
            mv "${gamelog}" "${gamelogdate}"
        fi
        if [ -f "${lgsmlog}" ]; then
            mv "${lgsmlog}" "${lgsmlogdate}"
        fi
        if [ -f "${consolelog}" ]; then
            mv "${consolelog}" "${consolelogdate}"
        fi

and it works now as expected.

<!-- gh-comment-id:2601029897 --> @wrecktify commented on GitHub (Jan 19, 2025): I updated the script manually to: ``` # Log rotation. fn_script_log_info "Rotating log files" if [ "${engine}" == "unreal2" ] && [ -f "${gamelog}" ]; then mv "${gamelog}" "${gamelogdate}" elif [ "${engine}" == "unity3d" ] && [ -f "${gamelog}" ]; then mv "${gamelog}" "${gamelogdate}" fi if [ -f "${lgsmlog}" ]; then mv "${lgsmlog}" "${lgsmlogdate}" fi if [ -f "${consolelog}" ]; then mv "${consolelog}" "${consolelogdate}" fi ``` and it works now as expected.
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#2949
No description provided.