Usage
Options
Snapshot ID to restore from. Can be:
- Full snapshot hash (e.g.,
a3f8d2e1...) - Short prefix (e.g.,
a3f8d2) latest(default) — restores the most recent snapshot
Output ZIP file path.The ZIP file will be created in the specified location. Parent directories must exist.
Restore only the given file or subtree.Examples:
Documents/report.pdf— restore a single fileDocuments/— restore entire Documents directoryPhotos/2024/— restore a subdirectory
Show what would be restored without creating the archive.Displays file count, directory count, and estimated uncompressed size.
Global Options
Examples
Output
Successful Restore
Dry Run Output
Archive Format
Restored files are packaged as a ZIP archive with the following properties:- Directory structure preserved — Files maintain their original paths
- File metadata — Modification times are preserved
- Compression — Standard ZIP deflate compression (data is already compressed in the repository, so additional compression gain is minimal)
- Permissions — File permissions and ownership are NOT preserved (limitation of ZIP format)
The ZIP archive contains the full directory tree. If you restore a single file like
Documents/report.pdf, the archive will contain a Documents/ folder with report.pdf inside.Snapshot Selection
You can specify snapshots in multiple ways:By Full Hash
By Short Prefix
By “latest”
Path Filtering
The-path flag filters files based on their path within the snapshot:
File Path
Restore a single file:Directory Path
Restore an entire directory (note the trailing slash):Nested Path
Restore a subdirectory:Paths are case-sensitive and must match the exact path structure in the snapshot. Use
cloudstic ls to explore the snapshot’s directory tree.Performance
Restore performance depends on:- File size — Larger files take longer to download and write
- File count — Many small files have more overhead than fewer large files
- Network bandwidth — Download speed from your storage backend
- Storage backend — Cloud storage (S3, B2) is slower than local storage
- Local storage: 100-500 MB/s
- Cloud storage (S3/B2): 10-50 MB/s (depends on your internet connection)
- SFTP: 5-20 MB/s (depends on SSH overhead and network latency)
Error Handling
If a restore fails:- The partially written ZIP file is automatically deleted
- Non-zero exit code is returned
- Error message indicates the cause (missing snapshot, network error, etc.)
- Snapshot not found — The specified snapshot ID doesn’t exist. Use
cloudstic listto view available snapshots. - Path not found — The specified
-pathdoesn’t exist in the snapshot. Usecloudstic ls <snapshot>to explore the snapshot contents. - Disk full — Not enough space for the output ZIP file.
- Permission denied — Can’t write to the output path. Check file permissions.
Concurrent Restores
Multiple concurrent restore operations are safe:- Restores only read from the repository (no writes)
- Multiple users can restore from the same repository simultaneously
- Restores do not interfere with backups or other operations
Encryption
If your repository is encrypted, you must provide credentials via:-encryption-password(orCLOUDSTIC_ENCRYPTION_PASSWORD)-encryption-key(orCLOUDSTIC_ENCRYPTION_KEY)-recovery-key(orCLOUDSTIC_RECOVERY_KEY)-kms-key-arn(for AWS KMS-encrypted repositories)
See Also
- cloudstic list — List all backup snapshots
- cloudstic ls — Browse files within a snapshot
- cloudstic diff — Compare snapshots to find changed files