LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

Backup specific files/folders

Open killerty69 opened this issue 8 years ago • 14 comments

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.

killerty69 avatar Oct 31 '16 07:10 killerty69

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

UltimateByte avatar Oct 31 '16 21:10 UltimateByte

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.

dgibbs64 avatar Oct 31 '16 21:10 dgibbs64

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

UltimateByte avatar Oct 31 '16 22:10 UltimateByte

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.

killerty69 avatar Nov 06 '16 16:11 killerty69

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.

UltimateByte avatar Nov 06 '16 20:11 UltimateByte

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.

nadal28 avatar Mar 06 '17 10:03 nadal28

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?

UltimateByte avatar Mar 06 '17 10:03 UltimateByte

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

nadal28 avatar Mar 06 '17 12:03 nadal28

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

dgibbs64 avatar Mar 07 '17 21:03 dgibbs64

Overkill, but I love it !

UltimateByte avatar Mar 07 '17 21:03 UltimateByte

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.

ghost avatar Aug 24 '17 15:08 ghost

Kinda relevant too #1563

marvinlehmann avatar Aug 24 '17 20:08 marvinlehmann

Related to #1595

dgibbs64 avatar Jul 21 '18 00:07 dgibbs64

link #2106

MicLieg avatar Apr 30 '24 16:04 MicLieg