nicolaschan/minecraft-backup

Check if the screen is running and cancel the update when not

Opened this issue · 1 comments

The script does currently not check whether the screen is running, resulting in a 'No screen session found.' error (multiple actually as the update goes on).
In that case of the error and if the screen was not specified the script continues running, which might be good, if you want to backup anyways just to be sure, but I'd prefer if the scripts exits. Maybe a flag for exiting on errors would be good.

You can test if the screen is running by checking the exit code of screen -S minecraft -Q select . &> /dev/null. I am currently checking this myself before I run the backup and will will maybe work on a pull request.

Great suggestion! I don't want to change the default behavior (which is to always backup), so I've added this behavior as a -g option commit 5eaae39 to the dev branch. You can suppress the warning message with -q. Feel free to try it out, and if it seems to be working well then I'll merge it into the master branch.