Editor Options Backup

dgc188

New Member
Due to a stupid action by myself I overwrote a final & fully working program and had to revert to something a few days old which was nowhere near complete and bug free.

In a previous session I had set the Editor Options, Backup to make backups every 10 minutes - this is set as my default. However, when the Editor is restarted (maybe the next day) this "default"/previously set setting fails to work and no timed backups are made. If, on the other hand, I go into the Editor Options, Backup and simply OK the settings (no changes, still set for 10 minute backups) the backups are then made as the setting states. But fails to work on a new session.

Is it possible that the Editor be amended/updated such that if Backups have been set to function, then this option becomes THE default and continues to be active between sessions? Everything else appears to be saved between sessions, but not this.

(PE 6.1.0.0)
 

inglewoodpete

Senior Member
It has been years since I actually needed to recover a backup copy of my PICAXE code. (I religiously use version numbering after being caught out too many times over the last 40 years!) I went and had a look for the backups and found them but not where the PE said it was placing them. PE Version 6.1.0.0

Perhaps you do have the backup files but somewhere where you're not looking?
PICAXE Backup Settings.JPG
 

neiltechspec

Senior Member
+1 for version numbering, even after minor or insignificant changes.
I too have been caught out many times in the past.

Neil.
 

dgc188

New Member
+1 for version numbering, even after minor or insignificant changes.
I too have been caught out many times in the past.

Neil.
This is fine if you physically make a save and want to update the file number every time. But that is purposely having to make a backup with a new filename. This (Options) backup system allows for a date/time suffix to be added automatically (every 10 minutes in my case) without having to make the save with a new filename. And it works fine for that session. But not the next session.

And to Pete...
The files are being backed up to where I want them (as stated in the Options, Backup) but only until I end the session. Start a new session and no auto backups made - anywhere. This is my niggle.

It might only be a small issue but when everything else in the Options is saved and used on each session - why not this backup option?

Surely, if the option to make backups is set, then it should become the default and work on every session and not having the need to go into Options, Backup and ok what is already set there.
 

dgc188

New Member
But it's an added function during a heads-down programming session to make that save/backup together with a version suffix.

All I'm looking at - and arguing for - is what is the purpose of having options that can be set if they become UNSET when a fresh session is started? That would then save the hassle - however slight that hassle might be - of having to stop a programming run and physically making that backup. It's already there in the options - but it doesn't work from one session to the next.
 

The bear

Senior Member
@ dgc188,
I don't have an answer to the backup problem. It's a good question, with a bit of luck you will get a good answer.
I have never tried the backup myself.
Regards, Bear..
 

thunderace7

New Member
I'm with dgc188. It is easy for me to spend an hour or more programming without realising where the time has gone and certainly without making incremental saves (with or without a version change). A lot of changes can be made in an hour and I wouldn't want to lose them. If settings are changed they should remain for further sessions. If I needed to change the colour scheme because I was colour blind I wouldn't expect to have to do it every time I used the program.
 

J G

Active member
Nowadays I often set up a local git repository (not synced with github or a server) and make a commit every time I do something major. While this is triggered manually, it does handle the saving backups to the correct locations, keeping a history of what you have done, as well as restoring to an earlier commit in the event of something going wrong or needing to look at the code in a particular state.

I have also tried using branches in local git repositories to add features that are not core to projects and automatically merge them in later, however I keep forgetting to change branches as I am editing :).

Another benefit of git is that you can sync the repository to another server or computer if you need to transfer files or make a proper backup on another hard disk / location.

Because I have swapped to mainly using ubuntu and don't have easy access to PE6, I have been using vs code, which does have automatic backups and a graphical interface for git. I do miss the built in pinout and memory map of picaxe chips, as well as the wizards and showing hints on mouse hover though.
 
Last edited:

inglewoodpete

Senior Member
But it's an added function during a heads-down programming session to make that save/backup together with a version suffix.

All I'm looking at - and arguing for - is what is the purpose of having options that can be set if they become UNSET when a fresh session is started? That would then save the hassle - however slight that hassle might be - of having to stop a programming run and physically making that backup. It's already there in the options - but it doesn't work from one session to the next.
You're correct. Version numbering (generally) is a milestone driven concept. It doesn't cover calamitous events like power dropouts, BSODs or unnoticed block deletes (I had/done them all ;o) ).

To add a little to my earlier post: why are the backup settings being maintained for me and not for you? It may be a quirky fault in the PE that relates to the particular backup option you are choosing.

Another thought: do you have full rights turned on in your computer? I have one app. (nothing to do with the PICAXE PE) that I have to start using "Run as Administrator" in order to get it to save its settings at shutdown.
 

The bear

Senior Member
In Post #7, I said that the backup option had not been used.
On checking it today, I have three in the backup folder, only one that is mine, the other two are programs that have been copied and saved by me.
Win10.
Bear..
 

dgc188

New Member
Thank you thunderace7 - I was beginning to think I was out on my own with this one.

Pete - thanks for the suggestion, but I am logged on as an administrator on the machine, so I "ought" to have full rights to everything. I have tried your suggestion about starting PE with Run as Administrator. No change to the no auto backups between sessions.

Incidentally, PE is started from a shortcut pinned to the Taskbar - in case that might make any difference. I don't think it does/should.

I even went into Apps & Settings and re-installed PE - in case something somewhere had gone amiss. All Backup settings still in place (Cancelled out rather than OK'ing it). Still no auto backups.

Changed the location of the working file to that on the hard disk - in case PE doesn't like pen drives. Still no auto backups.

I've also set PE to Run as Administrator in the (Task Bar shortcut) Properties box (2 tick boxes); also set here is Run in Compatibility Mode for Windows 8 - presuming this is correct.

Basically, I'm no further forward - other than having to go into Options, Backup EVERY time I start PE to ensure the auto backups work.

I guess this is one function that is NOT persistent from one session to another - unlike the other settings in the Options box.

Has ANYONE actually got it to work between sessions? If so, how?
Or is this something for the "next PE release" pile?

Thanks for bearing with me on this,
Dave
 

dgc188

New Member
I've found the PE settings file and found the following extract - after auto backup has been set:
<AutoBackup>true</AutoBackup>
<AutoBackupToWorkingFolder>true</AutoBackupToWorkingFolder>
<AutoBackupToDocs>true</AutoBackupToDocs>
<AutoBackupToCloud>false</AutoBackupToCloud>
<AutoBackupCloudFolder>C:\Users\Dave\Dropbox</AutoBackupCloudFolder>
<AutoBackupFrequency>10</AutoBackupFrequency>
<BackupOnDownload>true</BackupOnDownload>
<AddTimeStampToBackupFilename>true</AddTimeStampToBackupFilename>

Shut PE and restart fresh session - same (updated time stamp) file shows the same settings - but the auto backup fails.

I'm not quite sure where this leaves PE or my (and maybe some other installations around) setup, either Windows 10 or PE itself.

Any clues as to what is going on and how to fix it?
Dave
 

inglewoodpete

Senior Member
Has ANYONE actually got it to work between sessions? If so, how?
Or is this something for the "next PE release" pile?

Thanks for bearing with me on this,
Dave
Yes, as I've been saying, it has always worked for me. I first loaded PE V6 in early 2016 and currently use Version 6.1.0.0.

Windows 10 Home (64-bit) Vers. 2004, if that helps.
 

dgc188

New Member
PE 6.1.0.0 & Win10 Pro 2004 64-bit - but my PE got installed 2017. Total mystery.
Now for a total PE uninstall & restart the thing (rather than a refresh from within Win Settings).
 

Buzby

Senior Member
Wow !.

I'd forgotten about auto-backup, I must have set it years ago.

Checking 'C:\Users\<me>\Documents\PICAXE Editor\Backups' shows I've got 27,672 auto-backups going back as far as 2017.

Time to do some pruning !.

Cheers,

Buzby
 

dgc188

New Member
Confused? I'm getting there - confused, that is.

I've had it work - kind of - but not as I would wish, location-wise.

I started to try the auto backup settings on an old, old laptop yesterday - after having it taking ages to update itself to the latest Win10 (Pro) version. It's a 64-bit machine with a 32-bit version of win10 - don't ask me how that happened - it just did. Both laptops are latest Win10 Pro, both with PE6.1.0.0. Anyway.....

I had the auto backup work - then it didn't, then I changed a setting in the Options and it then worked, then it didn't. Not wholly reliable from what I could see while playing about with it (interspersed with other household duties). But....

I do get the impression that it won't auto backup unless certain criteria are met in regard to an edit/addition/change (as well as possibly/probably not restoring the settings on a new PE session) to the currently being worked on listing. I also get the impression it can be rather fussy about how/where it auto backs-up to as well.

From what I've seen, but not documented at each change I've made (across two machines), it might not work quite as advertised on the Options screen. Good set of options , however, giving the option of how/when/where to backup. If any of the PE authoring team are monitoring this, perhaps they could interject what the sets of criteria are for the auto backup to work - and what combinations of settings might cause it to fail. Because, fail it certainly can and does. Yet there are others on here that have it work fine. Confused? I'm getting there - confused, that is.

If I've nothing better to do today, I'll have another look at it - but it takes so much time changing one option after another and watching the results after each change that could be better spent actually programming or doing something useful instead.
 

dgc188

New Member
Last night, auto backups were set; today I've been editing and running a test program (editing without a 'save' - also following a 'save') and no auto backups are appearing - anywhere on the laptop or its pen drive. From last night's settings file:
<AutoBackup>true</AutoBackup>
<AutoBackupToWorkingFolder>false</AutoBackupToWorkingFolder>
<AutoBackupToDocs>true</AutoBackupToDocs>
<AutoBackupToCloud>true</AutoBackupToCloud>
<AutoBackupCloudFolder>C:\Backups</AutoBackupCloudFolder>
<AutoBackupFrequency>10</AutoBackupFrequency>
<BackupOnDownload>true</BackupOnDownload>
<AddTimeStampToBackupFilename>true</AddTimeStampToBackupFilename>

I just cannot fathom out the what or why on this. It seemed to work last night - but that might have been AFTER I made the settings (same session). New session earlier today, different file being edited, no auto backup. very :(

Now ALL auto backup options ticked. Created a new backup folder on HDD D:\dave\backups - checked permissions on that folder (slight difference to previous backup folder directly off C: \ - no full control for the "user" (me), despite having both read and write permissions). This new folder I have full control. Further edit to the file and saved it normally, then run the program.

Backups? Around 20 minutes later, one appears !!!! :) - or rather two have appeared - one in the D:\dave\backups folder and one where the main file is located, also but elsewhere on D:drive. I can see no options for the setting of permissions on the pen drive - maybe there is something in that, but I would have assumed there would be no restrictions. Maybe PE doesn't like pen drives where the files being editing are. And yet, it has made auto backups onto it, but only on a per session setting; taking no notice and not working on a new session.

As a test to see if the settings file was actually being read by PE at session start, I changed the colour for any amended/unsaved lines - this was recalled correctly on a new session. So that kind of answers/confirms thunderace7's comment in post #8 above. So there appears to be no "user rights" issues on either writing or reading the file. There's only the one (general) settings (xml) file and I can find nothing within the Registry relating to it (unless it's there in some form of 'binary/hex coding'). And the xx.bas.settings file shows nothing relating.

Because, fail? - it certainly can and does. But maybe with a mind of its own relative to pen drives and maybe to folders off the root of C:drive. In the past I heard that Windows can be a bit picky relative to C:drive. Further testing will be on-going (time permitting).

So why not creating the auto backup files every time? I would again ask the question from this morning's post.....
If any of the PE authoring team are monitoring this, perhaps they could interject what the sets of criteria are for the auto backup to work - and what combinations of settings might cause it to fail.
 

dgc188

New Member
What have I discovered from today's testing and mind games over this auto backup facility?
1. saving to pen drives appears not to be supported across sessions; only on a per session basis by going into the Options screen and OK'ing the settings each time a session is started. This is irrespective that the basic listing is being held, loaded from and being worked on with PE from the pen drive, even if the file is auto re-loaded from the pen drive.
2. creating a folder off the root of C:\drive for saving the backup files can have permissions issues (probably due to it being on the main Windows system partition, and MS being MS!) and will fail to write the backup files.
3. saving to a folder, any folder on a D:drive, so long as it's not removable is OK and works well.

It's a shame that pen drives appear not to be supported as I have a tendency to use a pen drive so that I can easily swap between this main laptop and the old secondary laptop which I use for the actual programming of the PICAXE devices and, occasionally, for programming tweaks when the program doesn't quite work in real time as it does in simulation - or for those times when SWMBO wants to use this laptop! And saving backup files to a pen drive would have made life so much easier.

Such is life. I hope I can now put an end to the problem of it working for some folk and not for me and, maybe, a few others. If there are any further comments or suggestions, I shall be pleased to hear them.

In the meanwhile, thanks to all those who have chipped in with their comments. It's all a great big learning curve - and we never stop learning.
Dave
 

J G

Active member
Are the usbs always mounted with the same drive letter? If so and they are always inserted before PE6 is started and removed after PE6 is stopped, would PE6 have any reason to suspect they are removable or not able to make backups to? Without testing anything, could it be that for some reason PE6 cannot access the filepath where the backups are and then attempts to ammend the preferences to match what it sees?

If you need to make a removable usb drive always mount with the same drive letter, you can assign a drive letter to a partition in the disk management utility and it should stay the same every time the drive is mounted (preferably choose a higher letter that shouldn't be automatically assigned).
 

dgc188

New Member
Thanks JG
The pen drive is (more or less) permanently mounted in the same usb socket when the laptop is powered on until it's powered off and it retains the same drive letter each session - Primary Partition F:drive. The only time it would get removed is to very occasionally use it on the other laptop - and that would be without PE running at the time of removal or being re-instated.

I guess this might well be another "quirk" from MS that it doesn't allow such auto backups/saves to removable media from a within program - unless the user physically makes that save or when the Options have been OK'd during that PE session. I can see no other reason for the behaviour. Just the same as I had problems when creating a backup folder on C:drive - I had read/write permissions but not full control - yet on my D:drive, I have that full control and auto backup seems to work.

A few more general comments, not necessarily specific to usb pen drives .....

I am still not 100% certain that all is well auto backing up to D:drive and under what conditions auto backup will kick-in. It worked last night, same Win10 session but different PE session. I've had PE running for a while this morning (new day, new Win10 session as well) and have made a few changes - the adding a couple of comment lines and the removal of various lines (both comment and otherwise unused commands) and I await to see whether auto backup works. Also I have yet to make a physical "save" or "run" after 30 minutes of this PE session (Options state 10 minutes).

After almost an hour of PE running, a few changes to the listing and now a "Run", the listing was saved, and Run again. After another 30 minutes and still NO auto backup. What is going on? Bearing in mind the long pathname (with spaces) on D:drive.

Now created new backup folder on F:\picaxe\AutoBackup (pen drive). It currently backs up to the "loading from" folder on D:drive (tick) and also to the new F:drive folder (tick). And that is without a "save". But all within the same set of sessions (Win, PE, day). New PE session....... small change made & a Run - NO autobackup.

Clear all reference to the F:drive (pen drive) and dual backup folders on D:drive and it works - after a while, possibly after a change, possible after a Run; all without a Save.
Now let's see if it works, tomorrow!

As I've already asked here, it would be nice and most helpful if someone would give a definitive description of the criteria for when auto backups operate - and to what locations - and what locations will not work.

In the meantime........ Questions......questions......and more questions to a more general audience/PE application authors:

1. What restrictions (if any) are there on (a) specific locations (drives/folders) - and/or (b) Permissions on that folder that may need to be physically set/updated - for auto backup to work (see comments above re pen drives and C:drive)?
2. Is there a limit on the "path length" to the auto backup folder?
3. Is there a restriction as to the inclusion of "spaces" within that pathname (I know there used to be issues with early version of DOS (within earlier Windows) that needed any pathname with a space character to be enclosed within quote marks)?
4. Is there a minimum number of characters - or program lines - that need to be added/removed/changed before auto backup works?
5. Does the listing need a physical "save" before auto backup works? Again, see my comment above re no auto backup after 30 minutes of PE running following a change in the listing without a physical save - and a further 30 minutes following a physical save (during Run mode) and a further 20 minutes after Run mode was stopped.
6. Does the program simulation need to be "run" before an auto backup is made?
7. Under Win10 (Pro and/or Home, etc.) does PE need to be run in Simulation Mode (for Win7 or Win8 - or earlier)? Or is it better without any Simulation Mode being set?

Some of these questions could be answered through much trial and error, but others may not be quite so straight forward without a lot of time being wasted and messing around that could be otherwise used more fruitfully.

I think Q1(a) might have been answered - PE doesn't appear to like removable pen drives across sessions - maybe also applies with removable hard disks (same difference, i.e. removable media)?
 

dgc188

New Member
Well, yesterday it worked - new day, new Win10 & PE sessions, no auto backup. Been running a new session for 60 minutes following a few changes to the listing and Running the changed listing. Another 30 minutes following a save and run - still no auto backups made.

So what changed? Nothing since yesterday's changes:
Settings file extract:
<AutoBackup>true</AutoBackup>
<AutoBackupToWorkingFolder>true</AutoBackupToWorkingFolder>
<AutoBackupToDocs>true</AutoBackupToDocs>
<AutoBackupToCloud>true</AutoBackupToCloud>
<AutoBackupCloudFolder>D:\picaxe\AutoBackups</AutoBackupCloudFolder>
<AutoBackupFrequency>10</AutoBackupFrequency>
<BackupOnDownload>true</BackupOnDownload>
<AddTimeStampToBackupFilename>true</AddTimeStampToBackupFilename>

No "spaces" (or any other unusual character) in the save-pathname;
Pathname length not excessive (but not directly off the root);
Pathname to the Working Folder is D:\picaxe\programs;
Not on a removable drive (separate partition on the only hard drive in the laptop);
Folder Permissions: Full control for System/Administrators/Users on the folder (Authenticated Users don't have full control, but does have Read/Write/Modify/etc);

And it still doesn't work. What the hell?????? Getting sick n tired of wasting valuable and scarce time on this - getting it to work would be wonderful and very useful in case of errors of any kind (other than power outages - but on a laptop this is not an issue).

I've now gone into the Settings file and manually changed a couple of bits, such as the AutoBackupCloudFolder to D:\backup - not that I believe it'll make the slightest difference - and pruned the RecentDocuments list.

Sorry guys (n gals) but this is really bugging me. I'm like a dog with a bone on this.
 
Top