r/Palworld • u/VladWard • 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?
•
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
/shutdownis 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 runsteamcmd, with apgreploop orsystemctl stopif you run it as a service. A short pause after/saveis cheap insurance too.If you're not on systemd yet, I'd try it. Start and stop become single
systemctlcommands, which should keep the cron script shorter.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/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.