feat(tui): add Work Directory setting for large archive operations
- Added WorkDir to Config for custom temp directory - TUI Settings: new 'Work Directory' option to set alternative temp location - Restore Preview: press 'w' to toggle work directory (uses backup dir as default) - Diagnose View: now uses configured WorkDir for cluster extraction - Config persistence: WorkDir saved to .dbbackup.conf This fixes diagnosis/restore failures when /tmp is too small for large archives. Use cases: servers with limited /tmp, 70GB+ archives needing 280GB+ extraction space.
This commit is contained in:
@@ -115,6 +115,26 @@ func NewSettingsModel(cfg *config.Config, log logger.Logger, parent tea.Model) S
|
||||
Type: "path",
|
||||
Description: "Directory where backup files will be stored",
|
||||
},
|
||||
{
|
||||
Key: "work_dir",
|
||||
DisplayName: "Work Directory",
|
||||
Value: func(c *config.Config) string {
|
||||
if c.WorkDir == "" {
|
||||
return "(system temp)"
|
||||
}
|
||||
return c.WorkDir
|
||||
},
|
||||
Update: func(c *config.Config, v string) error {
|
||||
if v == "" || v == "(system temp)" {
|
||||
c.WorkDir = ""
|
||||
return nil
|
||||
}
|
||||
c.WorkDir = filepath.Clean(v)
|
||||
return nil
|
||||
},
|
||||
Type: "path",
|
||||
Description: "Working directory for large operations (extraction, diagnosis). Use when /tmp is too small.",
|
||||
},
|
||||
{
|
||||
Key: "compression_level",
|
||||
DisplayName: "Compression Level",
|
||||
|
||||
Reference in New Issue
Block a user