chore: Replace production paths with generic examples
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.
This commit is contained in:
@@ -332,7 +332,7 @@ Restore full cluster:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Use NFS mount or larger partition for extraction
|
# 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.
|
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
|
```bash
|
||||||
# Extract to alternative location with more space
|
# Extract to alternative location with more space
|
||||||
./dbbackup restore cluster cluster_backup.tar.gz \
|
./dbbackup restore cluster cluster_backup.tar.gz \
|
||||||
--workdir /u01/dba/restore_tmp \
|
--workdir /mnt/storage/restore_tmp \
|
||||||
--confirm
|
--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)
|
# Special case: Limited system disk space (use alternative extraction directory)
|
||||||
sudo -u postgres ./dbbackup restore cluster cluster_backup.tar.gz \
|
sudo -u postgres ./dbbackup restore cluster cluster_backup.tar.gz \
|
||||||
--workdir /u01/dba/restore_tmp \
|
--workdir /mnt/storage/restore_tmp \
|
||||||
--confirm
|
--confirm
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ Examples:
|
|||||||
dbbackup restore cluster cluster_backup.tar.gz --jobs 4 --confirm
|
dbbackup restore cluster cluster_backup.tar.gz --jobs 4 --confirm
|
||||||
|
|
||||||
# Use alternative working directory (for VMs with small system disk)
|
# 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),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: runRestoreCluster,
|
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(&restoreDryRun, "dry-run", false, "Show what would be done without executing")
|
||||||
restoreClusterCmd.Flags().BoolVar(&restoreForce, "force", false, "Skip safety checks and confirmations")
|
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().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(&restoreVerbose, "verbose", false, "Show detailed restore progress")
|
||||||
restoreClusterCmd.Flags().BoolVar(&restoreNoProgress, "no-progress", false, "Disable progress indicators")
|
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)")
|
restoreClusterCmd.Flags().StringVar(&restoreEncryptionKeyFile, "encryption-key-file", "", "Path to encryption key file (required for encrypted backups)")
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ func (s *Safety) CheckDiskSpaceAt(archivePath string, checkDir string, multiplie
|
|||||||
" Available: %s\\n"+
|
" Available: %s\\n"+
|
||||||
" Archive: %s\\n"+
|
" Archive: %s\\n"+
|
||||||
" Check location: %s\\n\\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,
|
usagePercent,
|
||||||
FormatBytes(requiredSpace),
|
FormatBytes(requiredSpace),
|
||||||
FormatBytes(availableSpace),
|
FormatBytes(availableSpace),
|
||||||
|
|||||||
Reference in New Issue
Block a user