You are here: Foswiki>Tasks Web>Item12211 (02 Dec 2012, GeorgeClark)Edit Attach

Item12211: Configure should save previous file when saving a new configuration

pencil
Priority: Enhancement
Current State: Closed
Released In: 1.1.6
Target Release: patch
Applies To: Engine
Component: Configure
Branches: Release01x01 trunk
Reported By: TimotheLitt
Waiting For: Main.TimotheLitt
Last Change By: GeorgeClark
Configure should save a backup of the previous LocalSite.cfg when it writes a new one.

This makes recovery from errors (and diagnosing them) a lot easier.

Configure should output hash values in sorted order, not random order so a meaningful diff can be done.

New configuration item:
# **NUMBER EXPERT**
# Maximum number of backup versions of !LocalSite.cfg to retain when changes
# are saved.  Enables you to recover quickly from accidental changes.
# 0 does not save any backup versions.  -1 does not limit the number of versions
# retained.
$Foswiki::cfg{MaxLSCBackups} = 10;

Backups are saved only when an actual change happens. Old files are .n, where n starts at 1 and increases forever.

If a limit is set, the necessary number of the oldest files are deleted to get under the limit.

Thereafter, backups are NOT saved to the "hole" created in the version numbers, rather the version continues to increase.

-- TimotheLitt - 31 Oct 2012

Could we please save the backups in a backup folder? lib gets really cluttered.

-- ArthurClemens - 07 Nov 2012

Hm... How about working/configure/backup. (or something like that). That's where the extension installer puts its backups. I agree that lib does get a bit cluttered.

-- GeorgeClark - 07 Nov 2012

Don't think that's a good idea. Bootstrap issue. Also, if they're in a diferent place, you need to be an expert to know where to find them. Not good usability...my editor puts the backup next to the original file, as do most common tools.

If 10 seems cluttered, you can set the number saved down for your site. That's why there's a limit - it self-manages to that limit.

Or we could have the discussion about whether LSC should live in lib at all...perhaps a symlink to data, which is supposed to be writable.

(But I didn't mention it, no asbestos suit today.)

Installer is a different case; the system is known to be running then, and you can (or should be able to) ask configure for where / to re-install from them.

-- TimotheLitt - 07 Nov 2012
 

ItemTemplate edit

Summary Configure should save previous file when saving a new configuration
ReportedBy TimotheLitt
Codebase
SVN Range
AppliesTo Engine
Component Configure
Priority Enhancement
CurrentState Closed
WaitingFor TimotheLitt
Checkins distro:544fe258912c distro:6aa147469bb5
TargetRelease patch
ReleasedIn 1.1.6
CheckinsOnBranches Release01x01 trunk
trunkCheckins distro:544fe258912c
Release01x01Checkins distro:6aa147469bb5
Topic revision: r8 - 02 Dec 2012, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy