LinuxGSM
LinuxGSM copied to clipboard
Backup specific files/folders
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.
So if i got it, you want the backup to only backup specific files ?
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.
Unless maybe we find a way so that the user can input folders that he wants to save, at its own risk.
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.
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.
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.
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?
Yeah its good, at least for me, would be a great addition in my opinion
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
Overkill, but I love it !
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.
Kinda relevant too #1563
Related to #1595
link #2106