LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

[FEATURE] Add a blacklist file to prevent from backing up useless files

Open Sarrus1 opened this issue 3 years ago • 1 comments

My use case

I use LGSM to manage CS:GO servers, and I do backup every other weeks. However, each backup takes up to 13GB of space, and takes around 10 mins with the CPU running at 100% to complete.

The Idea

A way to reduce space taken up and time to run would be to implement a blacklist of the files we don't want to backup. In CS:GO's specific case, all .vpk files can be ignored for (i think) 99% of installation as they are only generic texture files that can be reobtained by running ./csgoserver validate.

A CS:GO server install is around 22Go without any custom maps. There are 166 .vpk files, each taking up more or less 120MB. The exact space they take up is around 20Go. Ignoring those files would shrink the backup file by around 90%.

My take on how to implement this

The simplest solution would be to whitelist files by extensions, (i.e ignore all .vpk files in my case)

However, for CS:GO and other source based games, it might be interesting to ignore some map files, while keeping others, for example not backing up de_dust2.bsp but backing up de_custommap.bsp.

Therefore, the best way to go around this would be to have a file called backup_blacklist.txt somewhere in lgsm/ and adding each file to be ignored, with its extension, line by line in this file.

I made a similar script using Python to generate a maplist.txt file which you can find here if that helps.

Thanks a lot for reading!

Sarrus1 avatar Feb 23 '21 13:02 Sarrus1