Backup Commands

Backup Mode Selection

The backup system supports different modes of operation through the --backup-mode flag.

pathmaster --backup-mode <mode>

Available Modes

default

pathmaster --backup-mode default
  • Backs up both PATH and shell configuration

  • Most comprehensive backup option

  • Recommended for major changes

path

pathmaster --backup-mode path
  • Backs up only PATH entries

  • Faster operation

  • Suitable for temporary PATH changes

shell

pathmaster --backup-mode shell
  • Backs up only shell configuration

  • Preserves shell customizations

  • Useful for shell-specific changes

switch

pathmaster --backup-mode switch
  • Toggles between backup modes

  • Cycles: PATH → SHELL → DEFAULT

  • Quick mode switching

Backup History

View available backups using:

pathmaster history

Output shows:

  • Backup timestamps

  • Backup types

  • File locations

Restore Operations

Latest Backup

pathmaster restore
  • Restores most recent backup

  • Automatic mode detection

  • Updates current session

Specific Backup

pathmaster restore --timestamp 20240301120000
  • Restores specific backup point

  • Requires exact timestamp

  • Full system state recovery

Best Practices

Regular Backups

  • Create backups before major changes

  • Use appropriate backup modes

  • Verify backup creation

  • Test restoration process

Backup Management

  • Review backup history regularly

  • Clean old backups periodically

  • Verify backup integrity

  • Document major changes