This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Snapshot

    Time Machine

    Piglet Run provides point-in-time recovery for both database and filesystem.

    Database PITR

    PostgreSQL’s built-in PITR (Point-in-Time Recovery) allows you to restore the database to any point in time. Managed by pgBackRest.

    # Show backup information
    pig pb info
    
    # List all backups
    pig pb ls
    
    # Create a full backup
    pig pb backup full
    
    # Restore to latest backup
    pig pb restore
    
    # Restore to specific time
    pig pb restore -t "2025-01-29 10:00:00"
    

    Filesystem Snapshots

    JuiceFS snapshots preserve the state of your workspace:

    # Create a snapshot (using juicefs CLI)
    juicefs snapshot create /jfs/data snapshot-before-experiment
    
    # List snapshots
    juicefs snapshot list /jfs/data
    
    # Restore from snapshot
    juicefs snapshot restore /jfs/data snapshot-before-experiment
    

    Use Cases

    ScenarioSolution
    AI broke codeRestore filesystem snapshot
    Bad database migrationUse pig pb restore -t <time>
    Experiment failedRoll back entire environment
    Need clean stateRestore to baseline snapshot

    Backup Management

    # View backup status
    pig pb info
    
    # View backup logs
    pig pb log tail
    
    # Create incremental backup
    pig pb backup incr
    
    # Create differential backup
    pig pb backup diff
    

    Next Steps