Someone mentioned the issue of file changes during tar while backup. I personally don't have much experience with shell and tmux , so I am sorry that I can't submit the repair code, but I have some ideas about this.
save-all needs time to complete the saving of all data. If sync and tar are executed before the save-all command has finished, inconsistencies will occur. The current processing method may have some problems. The time required for different machines to complete this task may vary greatly, and it is difficult to determine how long sleep is appropriate.
I found that when I execute save-all on the console, it will prompt [Server thread/INFO]: Saved the game when the task finishes. You can check whether the tmux terminal has output this string to determine whether the save has been completed, and then you can execute sync and tar.
Someone mentioned the issue of file changes during tar while backup. I personally don't have much experience with shell and tmux , so I am sorry that I can't submit the repair code, but I have some ideas about this.
save-allneeds time to complete the saving of all data. Ifsyncandtarare executed before thesave-allcommand has finished, inconsistencies will occur. The current processing method may have some problems. The time required for different machines to complete this task may vary greatly, and it is difficult to determine how longsleepis appropriate.I found that when I execute
save-allon the console, it will prompt[Server thread/INFO]: Saved the gamewhen the task finishes. You can check whether the tmux terminal has output this string to determine whether the save has been completed, and then you can executesyncandtar.