[GH-ISSUE #1163] Backup specific files/folders #909

Open
opened 2026-02-27 02:54:15 +03:00 by kerem · 14 comments
Owner

Originally created by @killerty69 on GitHub (Oct 31, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1163

More of a feature idea than an issue but shouldn't the backup script also back up saves as well, at least put an option to do so as well as just backing up the saves. We could just have a default location that it expects to find them with each game, but still ask where the location is for saves so they can just press enter if it is in the default location or type it out manually.

Originally created by @killerty69 on GitHub (Oct 31, 2016). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1163 More of a feature idea than an issue but shouldn't the backup script also back up saves as well, at least put an option to do so as well as just backing up the saves. We could just have a default location that it expects to find them with each game, but still ask where the location is for saves so they can just press enter if it is in the default location or type it out manually.
Author
Owner

@UltimateByte commented on GitHub (Oct 31, 2016):

So if i got it, you want the backup to only backup specific files ?

<!-- gh-comment-id:257429872 --> @UltimateByte commented on GitHub (Oct 31, 2016): So if i got it, you want the backup to only backup specific files ?
Author
Owner

@dgibbs64 commented on GitHub (Oct 31, 2016):

I think backing up only configs and saves is a good idea. However the issue we run in to is that different servers do it in different ways. So to be able to add this kind of support is very time consuming and a rather large pain. Not only that what about custom maps and add-ons. For us it would be very problematic to implement.

<!-- gh-comment-id:257433137 --> @dgibbs64 commented on GitHub (Oct 31, 2016): I think backing up only configs and saves is a good idea. However the issue we run in to is that different servers do it in different ways. So to be able to add this kind of support is very time consuming and a rather large pain. Not only that what about custom maps and add-ons. For us it would be very problematic to implement.
Author
Owner

@UltimateByte commented on GitHub (Oct 31, 2016):

Unless maybe we find a way so that the user can input folders that he wants to save, at its own risk.

<!-- gh-comment-id:257434886 --> @UltimateByte commented on GitHub (Oct 31, 2016): Unless maybe we find a way so that the user can input folders that he wants to save, at its own risk.
Author
Owner

@killerty69 commented on GitHub (Nov 6, 2016):

I agree with you dgibbs but my idea was just to have them input the location for their saves which we just run backup on the directory. We could have default locations for most games as it won't change, but we don't have to implement a restore function just zip up that folder. I can go ahead and work on that feature if you guys want it.

<!-- gh-comment-id:258692604 --> @killerty69 commented on GitHub (Nov 6, 2016): I agree with you dgibbs but my idea was just to have them input the location for their saves which we just run backup on the directory. We could have default locations for most games as it won't change, but we don't have to implement a restore function just zip up that folder. I can go ahead and work on that feature if you guys want it.
Author
Owner

@UltimateByte commented on GitHub (Nov 6, 2016):

I think this is a feature that should be added into a config file put into the lgsmdir. Some work would need to be made to LGSM first to make those kind of things easier, i think.

<!-- gh-comment-id:258709617 --> @UltimateByte commented on GitHub (Nov 6, 2016): I think this is a feature that should be added into a config file put into the lgsmdir. Some work would need to be made to LGSM first to make those kind of things easier, i think.
Author
Owner

@nadal28 commented on GitHub (Mar 6, 2017):

Agree, in RUST for example I only want to back up one directory, that contains server config files and some .sav files, but when I use ./rustserver backup it started copying 5.6 GB... when the files I only want to backup are only 30mb.

<!-- gh-comment-id:284356893 --> @nadal28 commented on GitHub (Mar 6, 2017): Agree, in RUST for example I only want to back up one directory, that contains server config files and some .sav files, but when I use ./rustserver backup it started copying 5.6 GB... when the files I only want to backup are only 30mb.
Author
Owner

@UltimateByte commented on GitHub (Mar 6, 2017):

So, I got I think, a good idea.

We could allow the user to set one or multiple dirs to backups (default would be known minimal backup) using a config variable, in addition to a new command:

Example variable:
backupcustomdirs="${rootdir}/${selfname}; ${systemdir}/dir/subdir; ${systemdir}/dir2; ${systemdir}/server.db; ${lgsmdir}"

Command:
./gameserver backup-custom

What do you guys think about it?

<!-- gh-comment-id:284363165 --> @UltimateByte commented on GitHub (Mar 6, 2017): So, I got I think, a good idea. We could allow the user to set one or multiple dirs to backups (default would be known minimal backup) using a config variable, in addition to a new command: Example variable: `backupcustomdirs="${rootdir}/${selfname}; ${systemdir}/dir/subdir; ${systemdir}/dir2; ${systemdir}/server.db; ${lgsmdir}"` Command: `./gameserver backup-custom` What do you guys think about it?
Author
Owner

@nadal28 commented on GitHub (Mar 6, 2017):

Yeah its good, at least for me, would be a great addition in my opinion

<!-- gh-comment-id:284382130 --> @nadal28 commented on GitHub (Mar 6, 2017): Yeah its good, at least for me, would be a great addition in my opinion
Author
Owner

@dgibbs64 commented on GitHub (Mar 7, 2017):

I have been thinking about this. The idea is for me to generate a list of files fro a default install (from steam) with md5 sums. This list will be an exclude list so only files that have been added after the default install will be backed up as it doesn't matter if a default map is deleted ans steamcmd will just re-download it. It may also be possible to use this method as a file downloader for non steam games. Like the new UT that does not have an updater yet. To do an update it would compare all files remotely with the locale ones any that do not match the check sum will be downloaded.

I would have to write a script with a repo of all games to check for updates says once per hour and re generate the list if there are any changes

<!-- gh-comment-id:284865997 --> @dgibbs64 commented on GitHub (Mar 7, 2017): I have been thinking about this. The idea is for me to generate a list of files fro a default install (from steam) with md5 sums. This list will be an exclude list so only files that have been added after the default install will be backed up as it doesn't matter if a default map is deleted ans steamcmd will just re-download it. It may also be possible to use this method as a file downloader for non steam games. Like the new UT that does not have an updater yet. To do an update it would compare all files remotely with the locale ones any that do not match the check sum will be downloaded. I would have to write a script with a repo of all games to check for updates says once per hour and re generate the list if there are any changes
Author
Owner

@UltimateByte commented on GitHub (Mar 7, 2017):

Overkill, but I love it !

<!-- gh-comment-id:284867999 --> @UltimateByte commented on GitHub (Mar 7, 2017): Overkill, but I love it !
Author
Owner

@ghost commented on GitHub (Aug 24, 2017):

For what it's worth, I did something similar to what @UltimateByte suggested except in reverse. I created a variable in the LGSM config pointing to a flat file with lines containing the directories and files I wanted to exclude and changed the tar command in "command_backup.sh" to use -X and point at the file.

It's more on me to update the exclusion file but this should require more work on the admin side than on the development side. Any comments?

In config

## Backup exclusions
exclusionfile="${configdir}/${gameservername}/backupexclusion.cfg"

New line in "command_backups.sh"
tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" -X "${exclusionfile}" ./*

Lines from "backupexclusion.cfg". Note my exclusions are for TF2.

## Default exclusion for "backups" directory
# Do not change
backups

## List custom exclusions here
# The exclusions can be folder names or files names
# Wildcards are accepted
# Note: Watch out for white spaces at the end of each line
maps
resource
hl2
*.vpk
*.vpk.sound.cache

Note that this list of exclusions for TF2 brought my backup size from 3GB+ down to 100MB.

<!-- gh-comment-id:324669163 --> @ghost commented on GitHub (Aug 24, 2017): For what it's worth, I did something similar to what @UltimateByte suggested except in reverse. I created a variable in the LGSM config pointing to a flat file with lines containing the directories and files I wanted to exclude and changed the tar command in "command_backup.sh" to use -X and point at the file. It's more on me to update the exclusion file but this should require more work on the admin side than on the development side. Any comments? In config ``` ## Backup exclusions exclusionfile="${configdir}/${gameservername}/backupexclusion.cfg" ``` New line in "command_backups.sh" `tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" -X "${exclusionfile}" ./*` Lines from "backupexclusion.cfg". Note my exclusions are for TF2. ``` ## Default exclusion for "backups" directory # Do not change backups ## List custom exclusions here # The exclusions can be folder names or files names # Wildcards are accepted # Note: Watch out for white spaces at the end of each line maps resource hl2 *.vpk *.vpk.sound.cache ``` Note that this list of exclusions for TF2 brought my backup size from 3GB+ down to 100MB.
Author
Owner

@marvinlehmann commented on GitHub (Aug 24, 2017):

Kinda relevant too #1563

<!-- gh-comment-id:324755975 --> @marvinlehmann commented on GitHub (Aug 24, 2017): Kinda relevant too #1563
Author
Owner

@dgibbs64 commented on GitHub (Jul 21, 2018):

Related to #1595

<!-- gh-comment-id:406754666 --> @dgibbs64 commented on GitHub (Jul 21, 2018): Related to #1595
Author
Owner

@MicLieg commented on GitHub (Apr 30, 2024):

link #2106

<!-- gh-comment-id:2085800460 --> @MicLieg commented on GitHub (Apr 30, 2024): link #2106
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#909
No description provided.