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:
@@ -32,6 +32,7 @@ type RestoreExecutionModel struct {
|
||||
cleanClusterFirst bool // Drop all user databases before cluster restore
|
||||
existingDBs []string // List of databases to drop
|
||||
saveDebugLog bool // Save detailed error report on failure
|
||||
workDir string // Custom work directory for extraction
|
||||
|
||||
// Progress tracking
|
||||
status string
|
||||
@@ -50,7 +51,7 @@ type RestoreExecutionModel struct {
|
||||
}
|
||||
|
||||
// NewRestoreExecution creates a new restore execution model
|
||||
func NewRestoreExecution(cfg *config.Config, log logger.Logger, parent tea.Model, ctx context.Context, archive ArchiveInfo, targetDB string, cleanFirst, createIfMissing bool, restoreType string, cleanClusterFirst bool, existingDBs []string, saveDebugLog bool) RestoreExecutionModel {
|
||||
func NewRestoreExecution(cfg *config.Config, log logger.Logger, parent tea.Model, ctx context.Context, archive ArchiveInfo, targetDB string, cleanFirst, createIfMissing bool, restoreType string, cleanClusterFirst bool, existingDBs []string, saveDebugLog bool, workDir string) RestoreExecutionModel {
|
||||
return RestoreExecutionModel{
|
||||
config: cfg,
|
||||
logger: log,
|
||||
@@ -64,6 +65,7 @@ func NewRestoreExecution(cfg *config.Config, log logger.Logger, parent tea.Model
|
||||
cleanClusterFirst: cleanClusterFirst,
|
||||
existingDBs: existingDBs,
|
||||
saveDebugLog: saveDebugLog,
|
||||
workDir: workDir,
|
||||
status: "Initializing...",
|
||||
phase: "Starting",
|
||||
startTime: time.Now(),
|
||||
|
||||
Reference in New Issue
Block a user