Proposal: Backup mechanism
issueid=61 25-11-2009 10:17
Super Moderator
Number of reported issues by Petr Schreiber: 146
Proposal: Backup mechanism

I think the current back up implementation is little bit too much brute force.

I would recomend to create just one backup file (created when user hits F5 button).
Then there would be button "Backup" on the toolbar, which user can press once he feels version of code is really worth backing up and it creates backup package for him in Backup directory.

I used this mechanism when developing TBGL before using SVN. I had simple srcbak.exe program, which had configuration file:
IGNORE_EXTENSIONS=RES,PBR,XPR,ZIP,BMP
IGNORE_DIRECTORIES=Release,ReleasePREVIEW,TestZone
REQUIRED_BACKUP_NAME=tbgl022_
It was prmitive, but worked well.

I think the backuper for TB could be done in similar way. Let me know what do you think about it.
If ok, I will code it in PB (configuration dialog, new cleaner INI file config scheme and the backuper itself) and pass to Eros as working block of code, to not bother him with programming this.


Petr
Issue Details
Issue Number 61
Issue Type Feature
Project thinAir and Visual Designer
Category Source code backup
Status Implemented
Priority Unknown
Suggested Version 1.8.6
Implemented Version 1.8.8
Milestone thinAir 1.8.8.0
Votes for this feature 0
Votes against this feature 0
Assigned Users (none)
Tags (none)




25-11-2009 10:46
thinBasic MVPs
I just need one backup file so when I delete the script accidently, I can retrieve the second last version of it. For version control, I would always use external tools.
To me the old way of doing backups was good enough.

26-11-2009 03:00
Member
Quote Originally Posted by Michael Hartlef
For version control, I would always use external tools.
What external tools are you referring to?


Mark

26-11-2009 03:05
Member
Quote Originally Posted by Petr Schreiber
I think the current back up implementation is little bit too much brute force.
Yeah, I don't like the constant reminders. There's too many back ups. But, it doesn't take that much time to click OK and move on. It's just one of those annoying things.

I would recomend to create just one backup file (created when user hits F5 button).
Then there would be button "Backup" on the toolbar, which user can press once he feels version of code is really worth backing up and it creates backup package for him in Backup directory.
Would the toolbar button replace the automatic F5 back up? The reason I ask is that eventually you would still collect tons of back up files. It would be nice if there was some automatic feature that deleted old backups. Even if it is just a button that the user pushes to delete all but the two or so most recent backups.


Mark

26-11-2009 10:01
thinBasic MVPs
Quote Originally Posted by Mark Lee
Quote Originally Posted by Michael Hartlef
For version control, I would always use external tools.
What external tools are you referring to?


Mark
SVN, GIT, there are several alternatives on the market for ffree. Or write your own one depending on what you need.

26-11-2009 10:39
Super Moderator
Would the toolbar button replace the automatic F5 back up?
No, with each hit of the magic Backup button it would create new folder with given user mask ("MyPrereleaseVersion_") and it would raise the number. It would not change the script file name at all. After 3 presses of Backup button:


[Backup]\
[MyPrereleaseVersion_01]
[MyPrereleaseVersion_02]
[MyPrereleaseVersion_03]


SVN is better solution of course, as this wouldn't be incremental backup.


Petr

26-11-2009 16:49
thinBasic author
Idea: what about if I use #SCRIPTVERSION directive already present in thinBasic?
I mean, I can use #SCRIPTVERSION to get the script version and use that info to save a backup file.

So, for example, if script is named MythinBasicScript.tbasic and inside it there is something like:
[code=thinbasic]#SCRIPTVERSION 1.3.0.1232[/code]

when script is saved it will also save in \BAK\ directory the following file:
[code=dos]MythinBasicScript_1.3.0.1232.tbasic[/code]

In few words backup file will be present only if script has #SCRIPTVERSION directive and backup file name will rely on version number indicated into #SCRIPTVERSION

Waiting for pro/cons
Eros

26-11-2009 18:33
Member
Quote Originally Posted by Eros Olmi
Idea: what about if I use #SCRIPTVERSION directive already present in thinBasic?
I mean, I can use #SCRIPTVERSION to get the script version and use that info to save a backup file.
In few words backup file will be present only if script has #SCRIPTVERSION directive and backup file name will rely on version number indicated into #SCRIPTVERSION
So, if you want to seperate back ups, you will need to change the #SCRIPTVERSION. Would it be an automatic process or one the programmer initiates?

And, what if you don't have a #SCRIPTVERSION directive? Will you still be able to back up through thinAir?



Mark

26-11-2009 18:48
Super Moderator
Eros,

this is not bad idea, only thing I would change is that you change the name of the script. I would propose to create directory with version number, and put script(s*) inside.

Thanks,
Petr
* In case of project

13-02-2011 15:53
thinBasic author
Moved to feature requests

22-08-2011 00:53
thinBasic author
Backup is now driven by manual choice of the programmer.
Every time programmer wants a backup copy of a source file, just use "Save and Backup" button and a backup copy of the source file will be saved into .\BAK\ directory with date and time in file name.

Eros

26-03-2013 13:35
thinBasic MVPs
I like the Save+Backup-feature and use it very often.
Every morning before I start typing I make backups of all my current code to have a sure stage to return to.
But it's very often the case that I'm not really awake and I forget to backup some unit.

Could there be some additional switch that does pretty much the same as hitting F5 or 'Save all':

"Save + Backup all"
(or just hold Shift-key while clicking Save+ Backup instead of adding another menu-item would be enough)
- so I'll never miss to backup a single unit of my current project - and I don't have to click all of them seperately to backup?

+ Reply