Modding Discussion Batch file for automatic save backup

Discussion in 'Starbound Modding' started by Vahkiti, Dec 22, 2013.

  1. Vahkiti

    Vahkiti Poptop Tamer

    Not sure how much of a mod this is, but I wasn't sure where else to post. Anyways, while playing today, I had to hard reset my computer. in doing so, my player and shipworld data became corrupted. I had made backups previously, but I hadn't kept up with it for a few days, so I lost quite a bit. That led me to wonder if there was a way to make a backup every time the program is quit...

    Just create a new text file named anything you like, copy the contents of the above, save and change the extension to .bat, then place that in the root of your Starbound directory. (eg: C:\Program Files (x86)\Steam\SteamApps\common\Starbound)

    What this does is launch the game through Steam, wait for the launcher process to be terminated, (you can rename this variable to starbound.exe if you prefer it to wait for that) then copies the player and universe folders in to a new directory called databackup within the Starbound folder, which will be re-copied and overwritten automatically every time you quit the game. If your computer is slower than mine at launching the game, you can change the timeout command variable to a higher number.

    Please note that launching the game through Steam itself will not run this file, you have to either run directly from the batch file, or create a shortcut to it somewhere on your computer. Alternatively, you could add it as a non-Steam game to your library and run it that way. Otherwise as far as I know, there's unfortunately no way to redirect a Steam game's launch path.

    Enjoy guys! :D
     
    Last edited: Dec 22, 2013
    zortbg likes this.
  2. zortbg

    zortbg Cosmic Narwhal

    Yay! Looks handy :) Thanks!
     
    Vahkiti likes this.
  3. Vahkiti

    Vahkiti Poptop Tamer

    You can also add this line at the end...

    ...if you want to copy screenshots from your Steam directory for easier access. X is the relevant user account data number. Just replace that with the appropriate target that applies to your account. :)

    EDIT: Made some changes in regard to another corrupting bug I managed to find regarding Steam itself.

    This will create a new folder within databackup with the backup's date and time every time you play the game. This is to ensure that the tool doesn't replace your backup with a corrupted file and that you always have something guaranteed functional to fall back on.

    A word of caution though, as the Universe folder can theoretically become near infinite in size, be mindful of how often you clean it out if you choose to use this launcher.
     
    Last edited: Dec 25, 2013

Share This Page