mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2026-04-24 21:56:01 +03:00
[GH-ISSUE #3300] [BUG] Valheim backup doesn't backup the worlds #2281
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference
starred/LinuxGSM#2281
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jclc on GitHub (Feb 24, 2021).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/3300
User Story
After doing a few backups of my server, I checked the contents of the tarballs and noticed that they don't actually contain the worlds, which are by default located in ~/.config/.
Basic info
To Reproduce
Steps to reproduce the behaviour:
./vhserver backuptar -tf <backup>Expected behaviour
Expected for the worlds to be listed.
I assume this can be fixed by changing the save location to be inside the server files directory, but saving the worlds regardless of save directory should be the default behaviour.
@mattclaw commented on GitHub (Feb 25, 2021):
Are you sure the version of the script you are running is latest? I think it'd be helpful to double check and share the exact version number in your issue.
I set up a fresh install just last night and ran a test backup. This backup contains a
.configdirectory which, in turn, contains several nested directories which ultimately house the world files. I recommend updating lgsm and trying again.This actually brings up a separate topic which might deserve its own issue... why does this backup script back up the installation of SteamCMD, the game, and miscellaneous support files? I can't think of a reason why I would want anything more than user-created data + configs.
This decision results in a bloated backup artifact. Default retention could be increased way beyond the current default value of 4 backups / 30 days. My world file is a mere 40MB after a week of playing with 4-7 players. I expect over time it will grow, but it will be some time before its size approaches the ~900MB of data contained within
serverfiles/.@jclc commented on GitHub (Feb 25, 2021):
This is interesting, did you install the server directly in the home directory or in a subdirectory? I've installed the server in a subdirectory, not sure if that makes a difference. If it's fixed in the latest version then I suppose this issue can be closed.
Personally I ended up moving the saves into the server directory since it's better to organise everything in one place anyway. The version of script I'm running doesn't have an option for the
-savedirswitch but that was easy to set up too.Yes, I noticed this too and it is pretty annoying. There seems to be a few open issues for adding support for blacklisting files/directories from backups, though.
@mattclaw commented on GitHub (Feb 25, 2021):
My install is bog standard; didn't deviate from the documented instructions, so yeah, there's a vhserver user and everything is installed directory into that user's home directory:

I am very new to this project, but I spent some time glancing at the scripts last night when I was trying to audit how lgsm works and how configurations work. If you're using a nonstandard file structure, perhaps you can override one of the config variables in your
vhserver.cfg. I know there is aserverfilesvariable which is widely used, but I'm not 100% sure that a config variable will solve your problem in the first place :/@jclc commented on GitHub (Feb 25, 2021):
I'm not using a nonstandard file structure, I've just installed the directory in a subdirectory rather than directly in $HOME. If the script looks for the default save directory relative to the installation directory, that is not acceptable.
@netstx commented on GitHub (Mar 2, 2021):
You can look into the code and check if it does that.
@Xalorous commented on GitHub (Mar 3, 2021):
The way the installation works, you can install ANYWHERE and the location you choose is the installroot. All of the other locations are relative to that location. Hardcoding $HOME/$USER as the installroot is restrictive. Suggesting $HOME/$USER is a great way to allow new admins or new linux users to stick to a standard configuration.
I do this stuff (Senior Linux Admin and DevSecOps) for a living, my serveradmin for valheim is vhserver, my install path is /home/vhserver.
@foozmeat commented on GitHub (Mar 9, 2021):
I just discovered this deficiency this morning while looking at moving my server to a new container. I installed lgsm into
/opt/LinuxGSMand my backups are a good copy of that folder however they don't contain the contents of~/.config/unity3d/IronGate/Valheim.One workaround would be to move the Valheim folder to inside of the LinuxGSM install folder and then symlink it back to the original location.
Another workaround would be to add the following to common.cfg to override the save dir
I think the second one is better as it matches the design pattern of lgsm.
@netstx commented on GitHub (Mar 9, 2021):
@mattclaw I think this is worthy of a new issue. I personally do container backups, but I agree the vhserver script backup should only save user generated data and configs. This makes for a lot smaller backups so you can keep many more versions without using tons of space.
@jclc commented on GitHub (Mar 9, 2021):
Since apparently you cannot blacklist the Mono runtime from being added to the backup (https://github.com/GameServerManagers/LinuxGSM/issues/3298), I ended up writing a short backup script for myself as a workaround anyway.
It assumes
-savedir "<server dir>/savedir". Resulting archive takes up less than a tenth of the space LGSM's backup uses. Feel free to use it if you like. https://gist.github.com/jclc/6b8a75af0c6f5233331afb4f0ae58e89@mattclaw commented on GitHub (Mar 9, 2021):
I realized after making this comment that one reason for this behavior would be to preserve a mod setup. I have no idea whether this is actually the case, but I'm not sure if saves from modded servers can be guaranteed to be backwards-compatible with vanilla saves. Perhaps having the exact server binaries backed up is beneficial in the case you need to rebuild a modded server at a particular version? Even still, I'd argue that would be better as opt-in behavior rather than default.
That's just my 2c as a newcomer to this project. If backing up all miscellaneous binaries and assets is an LGSM convention, it'd be inconsistent to make this change just to Valheim.
Going to yoink this, thanks so much.
@jclc commented on GitHub (Mar 9, 2021):
Remember to close the server first if you're going to schedule it. I made a bash script that first closes the server, runs the script and then starts the server again and put that on crontab.