I'm not a server guru (unfortunately) but have a decent knowledge of linux & bsd. I'm trying to symlink multiple instances of HLDS (game server) but need to exclude certain folders & config files to achieve this properly. I need to do it this way as HLDS loads many mods automatically, and putting an exception to disable the mods doesnt work for all of them.
so basically i want:
/home/user/hlds-install (the base install)
/home/user/server1
/home/user/server2
etc...
and then be able to manually put any configs/mods ive excluded into the server dir's so that each server can be configured individually.
Can anyone tell me how to do this, perhaps some sort of bash script so that I can just change the targets to run it each time i want to create a new one. I have quite a number to make so doing the whole thing manually for each one definately isn't an option and im all for working smarter, not harder!
Thanks :)
I assume you really mean "symlink everything inside the folder"...
Conceptually, you want something like:
bash logic to achieve this goes something like
Assuming you don't know already, the Advanced Bash-Scripting Guide should give you enough to work out what globbing you want (perhaps
find
) and how to convert that to a function (perhaps a recursive one).You could (ab)use xstow. This program is designed to populate a forest of symbolic links, which is close to what you want. It doesn't have an option to exclude some files, but you can hack it, sort of. For each server: