Jump to content

[1.10.0] S.A.V.E - automatic backup system - 1.10.0-3173


Nereid

Recommended Posts

S.A.V.E

automatic backup system

current version: 1.10.0-3173

Have you experienced some kind of major bug in a plugin? Did your save game got corrupt or have you lost all your ribbons in FinalFrontier, because of a single stupid mistake the developer (who is me unfortunately) has made? No? Well, you are lucky then. If you have experienced this, S.A.V.E may come to rescue. This plugin will handle automatic backups of your save games for you to prevent loss of data.

As most other software, this software comes with no warranty of any kind. If you use it, you do it at your own risk. :wink:

All releases until 0.9.11-319 will not backup your ship templates!

And a word of warning: I have tested this on Windows only. I do not know, if S.A.V.E works correctly on a MAC or on Linux.


Important! Please read!

This plugin will store the backups at the location on the file system that is set by the user! It may write on any location on the file system if the user changes the default location. Please keep this in mind, if you are setting S.A.V.E to a different backup location.

The default location for backups is: <KSP-HOME>/backup. There is a subfolder for each save game. Each backup is stored in a folder YYYYMMDD-HHMISS.

Folders containing a .nobackup file are not included in any backup. So if you do not want to backup a game or a subfolder of a game, just create a file of that name there.


Download: Spacedock

license: LGPLv3


Features:

  • Completely automatic; it will create a backup after a save
  • Backups can be stored anywhere in the file system ("a king who must say 'I'm the king' is no real king" :wink: -a backup on the same hard disk is no real backup)
  • Configurable backup interval
  • Configurable minimal number of successful backups
  • Configurable maximal number of backups
  • Configurable time in days to keep backups
  • Backup of all games at once
  • Restore functionality
  • Automatic backup before a restore is done.
  • Compressed backups
  • Cloning a game from a backup

Screenshot:

S.A.V.E.jpg


Hints:

  • Setting "days to keep backups" to 0 will keep backups forever (as long other constraints are not violated).
  • Setting "max number backups" to 0 will keep an unlimited amount of backups (as long other constraints are not violated).
  • Setting both "days to keep backups" and "max number backups" to 0 will never delete any backup (not even failed ones).
  • The value of "min number of backups" determines the number of successful backups that have to be kept in any case.
Edited by Nereid
1.10.0-3173
Link to comment
Share on other sites

This looks like it could be useful :)

Also, are you putting this on CKAN?

Please do not make this the standard response to every mod. CKAN is not the end-all application to manage mods.

I believe that putting it on Kerbalstuff automatically adds it to CKAN.

Link to comment
Share on other sites

This is very interesting.

Do you think it could be configured to also back up the GameData directory manually or at every successful start up? If it could be smart about it and backup GameData at every start up only if contents of it were modified since the last backup, that would be gravy!

Link to comment
Share on other sites

I remember Squad was imposing some restrictions on where mods are allowed to write and where not. Could that be a problem?

They have eased their restrictions as far as I remember. I will add a warning on the first page later, but it's obvious that this plugin will write its data to other parts of the file system if the user (!) decides to do so. Per default it will write in <KSP-HOME>/backup. If you change this, then it will write there.

The source is quite manageable. Everyone can check that it does no real harm.

- - - Updated - - -

This is very interesting.

Do you think it could be configured to also back up the GameData directory manually or at every successful start up? If it could be smart about it and backup GameData at every start up only if contents of it were modified since the last backup, that would be gravy!

I was thinking about that, because I have faced this problem many times, too. Just installed some new addons and something got broken... the problem is: It makes it more complicated. And the main rule for a backup is: "keep it as simple as possible".

Link to comment
Share on other sites

They have eased their restrictions as far as I remember. I will add a warning on the first page later, but it's obvious that this plugin will write its data to other parts of the file system if the user (!) decides to do so. Per default it will write in <KSP-HOME>/backup. If you change this, then it will write there.

The source is quite manageable. Everyone can check that it does no real harm.

I am in no way suggesting your mod is doing harm, I would just hate to see a good mod booted because the rules are the rules :)

Link to comment
Share on other sites

I am in no way suggesting your mod is doing harm, I would just hate to see a good mod booted because the rules are the rules :)

Well, it writes inside <KSP-HOME> per default (or to be more precise: the working directory KSP starts from). And now we are on interpretion land. If the user won't change the default path, it will not violate any rule. If a moderator or SQUAD instruct me to remove the option, I will obey. But it would be quite ridiculous.

EDIT: I have send a mail to a moderator to answer this question. Until answered, I will leave the decision to the user.

Edited by Nereid
Link to comment
Share on other sites

I was thinking about that, because I have faced this problem many times, too. Just installed some new addons and something got broken... the problem is: It makes it more complicated. And the main rule for a backup is: "keep it as simple as possible".

I don't think adding a GameData backup would necessarily add complexity.

If it's manual, it's simple and dumb. User activates GameData backup through the main menu UI, user is blocked from further operations until back up is done.

If it's automatic, it can go 2 ways:

1. At every launch, S.A.V.E. would hijack the loading screen or main menu to block the user. It would perform a dumb back up of GameData and then give control back to the user.

2. At every launch, S.A.V.E. would do a checksum of GameData and store it. It would then compare it to the previous checksum. If a difference exists, it will do the process in #1.

Method 1 is going to be very annoying from a usability standpoint, especially with KSP's crash-happy state with heavily modded games.

Method 2 adds a layer of complexity because it needs to rely on checksums. But a failed checksum, or losing the checksum data isn't exactly catastrophic. It would just perform a redundant backup as worst case scenario.

Link to comment
Share on other sites

I don't think adding a GameData backup would necessarily add complexity.

Well, I had some correlation GameData-Savegame in mind (restore a save, restore the corresponding GameData if the user chooses this option). But if we omit this correlation you are right.

To be prepared to remove the "outside of KSP-Install-folder backup option", I have moved all file operations in a separate class and create a define that will prevent all write operations outside the KSP installation folder. This way its easy for me (and everyone with a bit C# knowledge) to create a version with or without limitations if they were forced by SQUAD or the mods. And this way it would be way easier to check if the code does anything harmful.

Best solution would be some kind of minimal file support by SQUAD and a startup option of KSP that allows any plugin to write anywhere if its allowed by the user.

Link to comment
Share on other sites

There's a typo on the main screen - "once per hour" is repeated twice. And maybe there needs to be a "once per four hours" (two hours?) between "once per hour" and "once per day".

Thanks. Again, all copy&paste keys and menus should be disabled on developer keyboards. ;)

But the buttons do the same if selected. So it's just a cosmetic annoyance.

And there was another typo, with some more important consequences. The timespan between backups is used wrong.

http://beyondrelational.com/modules/1/justlearned/0/tips/9395/c-beware-of-difference-between-timespanminutes-and-timespantotalminutes.aspx

I'm fixing this. Until then only EACH SAVE is working correctly.

EDIT: The good news are this bug will just cause more backups than its supposed to do (but maybe not for daily or weekly backups).

- - - Updated - - -

Fixed in 0.9.10-309

This version will inform you, if you are storing backups outside the KSP installation folder with yellow colored backup path. If the backup path isn't permitted (maybe in a later version), the color will change to red.

This release should do all file operations in the class FileOperations. Currently it is not restricted in any way, but this may change.

Edited by Nereid
Link to comment
Share on other sites

Good news everyone!... S.A.V.E. appears to work in Linux... Atleast on my install at any rate (Fedora 20 x64) running thr 64 bit v of KSP.

EDIT: There seems to be one caveat though... the dialouge box won't go away once I'm in game and the hide button won't work. the function is fine it will make saves wherever I want them.

Edited by Lindy
Link to comment
Share on other sites

Good news everyone!... S.A.V.E. appears to work in Linux... Atleast on my install at any rate (Fedora 20 x64) running thr 64 bit v of KSP.

EDIT: There seems to be one caveat though... the dialouge box won't go away once I'm in game and the hide button won't work. the function is fine it will make saves wherever I want them.

Strange. I'm using the same technique as KSP-AVC and I will hide the GUI on any game scene event other than main menu. Maybe I did something wrong (again)? The GUI part is the most complicated thing in Unity sometimes...

Next year, we can analyze this with some log outputs if you want (or I install KSP on one of my Linux machines and do it myself).

Link to comment
Share on other sites

Just as some kind of info: The current version will not backup your ship templates! I will add this as an option in a later release (maybe today). I was completely targeted for the saves and just forgot to take care of subfolders.

EDIT: implemented in 0.9.11-319. :) It's optional (but enabled by default).

Edited by Nereid
Link to comment
Share on other sites

Setting this up with the default backup path, "recurse subfolders", interval of "once in 2 hours", "days to keep" of 14, min of zero, max of 100 -- and the status tab always reads "failed".

(Defaults of "min 10" and "max 50" might be good.)

It's the "recurse subfolders" option that is causing the status tab to read "failed". Which also causes the backup not to be listed on the "restore" tab.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...