← Back to team overview

kicad-developers team mailing list archive

Re: Auto-generated backup files: are they useful?

 

I find them annoying and have to add them to my gitignore's etc constantly.

They're of no value to me because I tend to save every 30 seconds or so
while working.

The *one* thing they might be useful for is guarding against kicad
segfaulting or other failures (disk full, NFS connection lost, etc)
during the save process itself. To do this, I'd suggest:

* Move old file to file.bak
* Write new file
* Delete old file if everything worked. If something goes wrong before
reaching this point, you can restore from the bak.

On 6/29/20 12:23 PM, Jon Evans wrote:
> Currently, KiCad automatically creates backups of schematic and PCB
> files when you save a file.
> 
> The logic for these backups is basically: if a file already exists
> with the same name as what we are saving, copy that file to a new file
> and give it the "-bak" suffix on the file extension.
> 
> These backups are stored next to the original file in the current
> KiCad codebase.  This understandably creates clutter that some people
> don't like (myself included) so in the project-settings branch that is
> about ready to be merged, I changed this behavior to place all these
> backups in a special backups folder for the project.
> 
> This proved to have some complications around the handling of files
> outside the project path (which it's possible to have with
> hierarchical schematic sheets) so I need to do something else.
> 
> After some thought, I am pretty convinced that the right thing to do
> is just *remove this backup feature entirely*.  Here's why:
> 
> 1) It's not a very good backup:  It just stores the state from the
> last time you hit "save".  If you hit save again, your backup is blown
> up.  So, it's really like a "undo" function, but on disk, and with
> only one level of undo.
> 
> 2) Recently I changed how we save schematic and board files to fix
> some unrelated issues people were seeing with cloud backup services.
> Before this change, if KiCad crashed or had some other serious error
> while saving a file, the file would be lost (because we used to delete
> the old file and then write a new one in its place).  After this
> change, we write the new file to a temporary location, and only if
> that write succeeds do we copy it on top of the old file.  I think
> this vulnerability to generating corrupt files if we crash was one of
> the reasons for this backup file system, and that reason is now gone.
> 
> 3) Because it's not a very good backup, I worry that the fact that
> "bak" files exist might cause some users to have a false sense of
> security and not use a true backup system (like a version control
> system, or some other mechanism that actually backs up files
> periodically).  I want to remove this false sense of security so that
> it is more clear that users should back up their files in some way if
> they care about the work.
> 
> In other words, I don't think this feature actually gives enough value
> to make it worth the clutter in the project folder and/or the
> development effort to make it work well with less clutter.
> 
> So, I'd like to hear from others on this: anyone disagree?
> 
> Thanks,
> Jon
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


Follow ups

References