brianmiller / phvalheim-server

PhValheim backend server
GNU General Public License v2.0
26 stars 5 forks source link

Preserve hardlinks when recreating config/plugin folders #42

Open Shadark opened 1 year ago

Shadark commented 1 year ago

Hi, I've found this issue when I was configuring some plugins like DiscordConnector and WebMap. These mods create persistent files that aren't preserved when Updating the Valheim setup or when installing new mods. (I asked about these issues in the Discord beforehand, same handle as here)

I tried to solve this by creating hardlinks to the newly created files inside the custom_config[_secure] and custom_plugins folders. The issue is, it works for the first time until the first reset. The container copies the files inside the custom folders, without preserving the hardlinks. This serves only as a "backup" until the next reset. I have to recreate the hardlinks each time I update the server.

I suggest this change, but I'm not UNIX-savvy and I don't know if it would create other issues when copying with -a instead of -p. Feel free to suggest any changes.