From cfa51c4b377c5a967d92aadb87f70202b2476620 Mon Sep 17 00:00:00 2001 From: Renz Date: Fri, 28 Nov 2025 13:27:12 +0000 Subject: [PATCH] chore: Replace production paths with generic examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sanitized all production-specific paths: - /u01/dba/restore_tmp → /mnt/storage/restore_tmp - /u01/dba/dumps/ → /mnt/backups/ Changed in: - cmd/restore.go: Help text and flag description - internal/restore/safety.go: Error message tip - README.md: All documentation examples - bin/*: Rebuilt all platform binaries This ensures no production environment paths are exposed in public code/docs. --- README.md | 6 +++--- cmd/restore.go | 4 ++-- internal/restore/safety.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 775812b..62358f5 100755 --- a/README.md +++ b/README.md @@ -332,7 +332,7 @@ Restore full cluster: ```bash # Use NFS mount or larger partition for extraction -./dbbackup restore cluster cluster_backup.tar.gz --workdir /u01/dba/restore_tmp --confirm +./dbbackup restore cluster cluster_backup.tar.gz --workdir /mnt/storage/restore_tmp --confirm ``` This prevents "insufficient disk space" errors when the backup directory has space but the system root partition is small. @@ -648,7 +648,7 @@ If your system disk (where PostgreSQL data resides) is small but you have large ```bash # Extract to alternative location with more space ./dbbackup restore cluster cluster_backup.tar.gz \ - --workdir /u01/dba/restore_tmp \ + --workdir /mnt/storage/restore_tmp \ --confirm ``` @@ -785,7 +785,7 @@ sudo -u postgres ./dbbackup restore cluster cluster_backup.tar.gz \ # Special case: Limited system disk space (use alternative extraction directory) sudo -u postgres ./dbbackup restore cluster cluster_backup.tar.gz \ - --workdir /u01/dba/restore_tmp \ + --workdir /mnt/storage/restore_tmp \ --confirm ``` diff --git a/cmd/restore.go b/cmd/restore.go index 31bd1ce..414c4d1 100755 --- a/cmd/restore.go +++ b/cmd/restore.go @@ -138,7 +138,7 @@ Examples: dbbackup restore cluster cluster_backup.tar.gz --jobs 4 --confirm # Use alternative working directory (for VMs with small system disk) - dbbackup restore cluster cluster_backup.tar.gz --workdir /u01/dba/restore_tmp --confirm + dbbackup restore cluster cluster_backup.tar.gz --workdir /mnt/storage/restore_tmp --confirm `, Args: cobra.ExactArgs(1), RunE: runRestoreCluster, @@ -233,7 +233,7 @@ func init() { restoreClusterCmd.Flags().BoolVar(&restoreDryRun, "dry-run", false, "Show what would be done without executing") restoreClusterCmd.Flags().BoolVar(&restoreForce, "force", false, "Skip safety checks and confirmations") restoreClusterCmd.Flags().IntVar(&restoreJobs, "jobs", 0, "Number of parallel decompression jobs (0 = auto)") - restoreClusterCmd.Flags().StringVar(&restoreWorkdir, "workdir", "", "Working directory for extraction (use when system disk is small, e.g. /u01/dba/restore_tmp)") + restoreClusterCmd.Flags().StringVar(&restoreWorkdir, "workdir", "", "Working directory for extraction (use when system disk is small, e.g. /mnt/storage/restore_tmp)") restoreClusterCmd.Flags().BoolVar(&restoreVerbose, "verbose", false, "Show detailed restore progress") restoreClusterCmd.Flags().BoolVar(&restoreNoProgress, "no-progress", false, "Disable progress indicators") restoreClusterCmd.Flags().StringVar(&restoreEncryptionKeyFile, "encryption-key-file", "", "Path to encryption key file (required for encrypted backups)") diff --git a/internal/restore/safety.go b/internal/restore/safety.go index 6f857eb..696f6e5 100755 --- a/internal/restore/safety.go +++ b/internal/restore/safety.go @@ -264,7 +264,7 @@ func (s *Safety) CheckDiskSpaceAt(archivePath string, checkDir string, multiplie " Available: %s\\n"+ " Archive: %s\\n"+ " Check location: %s\\n\\n"+ - "Tip: Use --workdir to specify extraction directory with more space (e.g., --workdir /u01/dba/restore_tmp)", + "Tip: Use --workdir to specify extraction directory with more space (e.g., --workdir /mnt/storage/restore_tmp)", usagePercent, FormatBytes(requiredSpace), FormatBytes(availableSpace),