KBackup-Fabric
KBackup-Fabric copied to clipboard
[REQUEST] Update RconJobs to continue polling after returning ConnectionRefusedError:
Sorry to make this request if its too much time or trouble. I would have made it on the page for your RconJobs project but you've archived it. I also noticed you removed it as your solution for scheduled backups from the readme for this project :(
As it is now, if the server is stopped or does not respond to RconJobs, RconJobs returns a ConnectionRefusedError, and then stops polling its jobs, but does not go back to the command prompt.
error: https://pastebin.com/bggj7WNq
I was wondering if you could either make RconJobs continue polling after receiving this error, or maybe force it to quit to the command prompt so that a looping batchfile/script could simply start it up again once it quits to the command prompt.
Thanks, and good luck with your new backup project that you mentioned! KBackup works well and is extremely useful for me, I look forward to your future releases and projects :)
Well, this does not bother me, I am more than happy to hear replies from the community. :)
It was a few weeks after I wrote RconJobs when I realized that RconJobs does not resolve so much new problem. RconJobs could be replaced with the combination of Linux's crontab and a CLI RCON client such as mcrcon (which I am using right now). This RCON client could handle IO errors correctly, so I just did not want to spend time mending my crappy code. I just forgot to mention in the README that nowadays I am using a command line RCON client in system schedule task rather than using the wheel rolled by my self (I mean RconJobs), which is prone to error. I will update it soon.
However, RconJobs could be useful if the server is running on a system where schedule tasks is not available (such as some rent servers). If you are not in this situation, I recommend you using the system scheduled tasks to run mcrcon regularly, backing up your world. IO error will fail the single task run, not the whole scheduler.
As a quick fix, assuming you are under Linux, run crontab -e and append this line to the configuration:
0 */6 * * * mcrcon -P <RCON port> -p <RCON password> "kb backup"
This will cause cron to run kb backup for every 6 hours. To make incremental backups, simply replace kb backup to kb incbak.
I didn't implement this by myself because I don't need it. However, you may have noticed that the two open issues are both related to regular backups. This might mean that many people like you are finding a suitable regular backup solution. I will document the RCON solution in README and CurseForge page as a temporary solution and implement regular backups in the future.
(If someone reading this could help implementing the integrated regular backup feature, feel free to open PRs.)