config.g.bak?
-
Hi All,
Why do I occasionally get a config.g.bak file in the system directory? Is this written because the config.g file is invalid? Any way to tell if the system is reading from the config.g or config.g.bak?
Thanks.
- Hardware: Duet v0.6
- Firmware: 1.22 (2018-07-26b2)
- DWC: 1.22.4
-
@doctrucker said in config.g.bak?:
Hi All,
Why do I occasionally get a config.g.bak file in the system directory? Is this written because the config.g file is invalid? Any way to tell if the system is reading from the config.g or config.g.bak?
Thanks.
- Hardware: Duet v0.6
- Firmware: 1.22 (2018-07-26b2)
- DWC: 1.22.4
I have always assumed it is generated whenever config.g is edited.
Frederick
-
@fcwilt said in config.g.bak?:
@doctrucker said in config.g.bak?:
Hi All,
Why do I occasionally get a config.g.bak file in the system directory? Is this written because the config.g file is invalid? Any way to tell if the system is reading from the config.g or config.g.bak?
Thanks.
- Hardware: Duet v0.6
- Firmware: 1.22 (2018-07-26b2)
- DWC: 1.22.4
I have always assumed it is generated whenever config.g is edited.
Frederick
Yep, when you edit the config file through the DWC.
-
Ok, so it is DWC that uses it rather than the machine, and the machine never uses it? Feature request for DWC to clean it up after use to save confusion or themachine to delete it on startup if present?
-
@doctrucker I don't think automatically deleting a backup file is optimal behaviour. Why even create the backup in the first place?
I would think that a notification of the creation of the file would be sufficient.
-
@doctrucker said in config.g.bak?:
Ok, so it is DWC that uses it rather than the machine, and the machine never uses it? Feature request for DWC to clean it up after use to save confusion or themachine to delete it on startup if present?
You can always delete it yourself but I think keeping a backup is a good idea - even if it only contains the contents of the previous config.g.
From time to time I use the DWC to download and save backups of all the various .G files needed for a complete configuration.
Frederick
-
@bot I think the reason it is done is to stop two processes accessing/modifying the same data at the same time. At a guess DWC is creating this file so you can read and modify it without potentially accessing it at the same time as the duet ie, mid build. The rename opperation it atomic, meaning that other processes can't interrupt it by accident. I doubt it is a user backup and as such it is pretty useless as the most likely thing to happen that will cause data loss is sd card failure.
If it is indeed the previous config when chanhes have been made then that needs to be more obvious.
-
@doctrucker said in config.g.bak?:
If it is indeed the previous config when chanhes have been made then that needs to be more obvious.
It seems to be that - I just compared the two files on my machine.
Frederick
-
That's right: whenever you edit config.g in DWC, it saves the previous version as config.g.bak to make it easier for you to roll back your changes.
-
That's fair enough, a fall back option rather than back up.
Perhaps add a comment at the top of the file something along the lines of:
; 20181206 0836 Copy of old config superseeded by user through DWC.
I had though I'd mucked up the config some how and the .bak was some kind of fall back the system created when it couldn't read config.g!