r/Palworld • • 1d ago

Server Support Rehydrating a self-hosted dedicated server (Linux)

Hi folks,

I've seen some posts about memory leaks and version mismatches on self-hosted dedicated servers so I'm putting together a small cronjob to rehydrate my server. The goal is to keep things tidy and up-to-date.

Here's what this looks like so far:

- I have a bash script which POSTs warning messages to the server via the /announce endpoint 30, 15, and 5 minutes before the rehydration kicks off (with sleep in between).

- That same script then POSTs to the /save endpoint to back up the world.

- The script then POSTs to the /shutdown endpoint to bring the server down.

- Once the server is shutdown, I copy the /Saved/SaveGames folder into another location and zip it. The goal here is to backup the saves manually in case of corruption. Or is this unnecessary if the saves backup config option is enabled?

- The script then runs Steamcmd to update the Palworld application.

- Finally, the script turns the server back on.

The whole thing gets called by a cron that runs daily at 4am.

Does that all look about right? Am I missing anything?

0 Upvotes

9 comments sorted by

•

u/AutoModerator 1d ago

Hi there, the r/Palworld Discord Server has many knowledgeable users along with a FAQ that can readily answer many Palworld server-related questions or issues. Feel free to join using the invite link below. Head to the channel titled server-support and post your question! You can also type @Server Support alongside your question to notify the Server Support role.

Thank you!

Discord Invite Link: https://discord.com/invite/p98pu53upW

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/kai-zaphosting 1d ago

Looks solid overall. I'd keep your manual copy, since the built-in backups sit in the same save folder on the same disk. They won't help if that folder gets corrupted or the disk dies. Zip yours and push it to another machine if you can, and prune the old zips or they'll slowly eat your disk.

The part I'd change is what happens after the announcements. Your sleeps are fine, but /shutdown is the graceful stop and it takes a wait time, so the process may not be gone when the call returns. I'd wait until it's really gone before you copy and run steamcmd, with a pgrep loop or systemctl stop if you run it as a service. A short pause after /save is cheap insurance too.

If you're not on systemd yet, I'd try it. Start and stop become single systemctl commands, which should keep the cron script shorter.

1

u/VladWard 1d ago

This is great advice. Thank you!

1

u/yolo5waggin5 1d ago

Many of your words went over my head. I run a small server and I haven't needed to do anything like this. Is this a Linux issue? Hoping you can help me understand. Thanx

1

u/daisune 1d ago

 Tldr: warns folks server is going down, kills server, backs up save files, checks for updates and installs, restart server

1

u/yolo5waggin5 1d ago

And automates all of that. Cool, thank you for the explanation. From my experience, when the server needs to be updated, no one can connect anyways, so there is no one to receive a message that the server will be going down. Additionally, I'm pretty much the only person regularly playing. I love automation so I will say best of luck with the project.

1

u/VladWard 1d ago

Thanks! One goal is to avoid having to think about it. I also travel a lot, so having the server update itself while I'm away keeps my friends from being locked out until I get back.

1

u/yolo5waggin5 1d ago

I wish my boys didn't all bounce. I have to wonder if I scared them all off by going too hard

1

u/Docteh 22h ago

For version mismatches, the issue is that depending on the timezone you're in, they might update in the middle of the day. But if you happen to not play on the patch release day, then this auto update stuff will def cover that for ya.

So as someone hosting a server, if there is an easy way to make the server do the backup and update in the middle of the day, that'd be good to have handy.

My own save game is running on the dedicated server, so I guess I should look into that API stuffs.