I wanted to try your backupmodx.php script, but I didn't succeed. The file does not even run (error in line 515, unexpected '}').
After having a closer look at the code, I got the impression that something went wrong while uploading it to GIT. Is it possible, that the lower half of the file backupmodx.php consists of code of installmodx.php? Or is it just too late and I should get some sleep :)