Overview
Thecloudstic forget command removes snapshots from the repository. It supports two modes:
- Single snapshot mode — Remove a specific snapshot by ID
- Policy mode — Apply retention rules to automatically keep/remove snapshots based on age and frequency
forget only deletes the snapshot objects themselves. The actual data chunks remain in the repository until you run prune to reclaim storage.
Usage
Remove a specific snapshot
Apply a retention policy
How It Works
Single Snapshot Mode
- Deletes the specified snapshot object (
snapshot/<id>) - Updates the snapshot catalog to remove the entry
- If the deleted snapshot was the latest, re-elects a new latest from remaining snapshots
- Optionally runs prune if
-pruneflag is set
Policy Mode
- Load snapshots — Reads all snapshots from the repository
- Filter — Applies filters (
-tag,-source,-account,-path) to select candidates - Group — Groups snapshots by fields (
-group-by) like source, account, or path - Evaluate policy — For each group, applies retention rules to determine keep/remove sets
- Remove — Deletes snapshots not matched by any keep rule
- Prune — Optionally runs garbage collection if
-pruneflag is set
OR logic: A snapshot is kept if it matches ANY keep rule. For example, if a snapshot is both a “last” snapshot and a “daily” snapshot, it will be kept.
Options
Flags
Automatically run prune after forgetting to reclaim storage space. Without this flag, storage is not freed until you manually run
cloudstic prune.Default: falseShow what would be removed without actually deleting anything. Displays keep/remove decisions for each group.Default:
falseLog detailed information about each snapshot being processed.Default:
falseRetention Policy Options
Keep the N most recent snapshots (by creation timestamp).Default:
0 (disabled)Keep one snapshot per hour for the last N hours that have snapshots. Keeps the newest snapshot in each hourly bucket.Default:
0 (disabled)Keep one snapshot per day for the last N days that have snapshots. Keeps the newest snapshot in each daily bucket.Default:
0 (disabled)Keep one snapshot per ISO week for the last N weeks that have snapshots. Keeps the newest snapshot in each weekly bucket.Default:
0 (disabled)Keep one snapshot per month for the last N months that have snapshots. Keeps the newest snapshot in each monthly bucket.Default:
0 (disabled)Keep one snapshot per year for the last N years that have snapshots. Keeps the newest snapshot in each yearly bucket.Default:
0 (disabled)Filtering Options
Only consider snapshots that have this tag. Can be specified multiple times — snapshots must have ALL specified tags.Default: (none)
Only consider snapshots from this source type (e.g.,
local, gdrive, onedrive).Default: (none)Only consider snapshots from this account (e.g.,
user@example.com for cloud sources).Default: (none)Only consider snapshots from this source path.Default: (none)
Grouping Options
Comma-separated list of fields to group snapshots by before applying the policy. Valid fields:
source, account, path, tags. Empty string disables grouping (applies policy globally).Default: "source,account,path" (group by source identity)Global Options
-store,-store-path— Storage backend configuration-encryption-password,-encryption-key— Repository credentials-quiet— Suppress progress bars
Examples
Remove a specific snapshot
abc123def456. Storage is not reclaimed until prune runs.
Remove a snapshot and prune immediately
Keep last 10 snapshots
Keep daily snapshots for 30 days
Comprehensive retention policy
- 5 most recent snapshots
- 1 snapshot per day for last 7 days
- 1 snapshot per week for last 4 weeks
- 1 snapshot per month for last 12 months
- 1 snapshot per year for last 2 years
Preview retention policy
Keep snapshots with specific tag
production. Other snapshots are unaffected.
Separate policies per source
user@example.com. Due to default grouping, snapshots from other sources are unaffected.
Global policy (no grouping)
Output
Single Snapshot Mode
Policy Mode
Policy Mode with Prune
Understanding Retention Policies
Time Buckets
Time-based rules (hourly, daily, weekly, monthly, yearly) work by grouping snapshots into buckets:- Hourly:
2026-03-03 10(year-month-day hour) - Daily:
2026-03-03(year-month-day) - Weekly:
2026-W09(ISO year-week) - Monthly:
2026-03(year-month) - Yearly:
2026(year)
OR Logic
A snapshot is kept if it matches any keep rule. For example:- The 5 most recent snapshots are kept due to
--keep-last - Additionally, one snapshot per day for the last 7 days is kept due to
--keep-daily - If a snapshot qualifies under both rules, it’s kept (and shown with multiple reasons)
- Snapshots that match neither rule are removed
Grouping
By default, policies are applied per(source, account, path) group. This means:
- Local backups from
/home/user/docsand/home/user/photosare treated as separate groups - Google Drive backups from different accounts are treated as separate groups
- Each group has the policy applied independently
-group-by to customize:
Difference Between Forget and Prune
| Command | Purpose | What It Removes | Storage Impact |
|---|---|---|---|
| forget | Remove snapshots from history | Snapshot objects (snapshot/*) | Minimal (only snapshot metadata) |
| prune | Reclaim storage from unreachable data | Orphaned chunks, content, filemeta, HAMT nodes | Significant (actual file data) |
Key concept:
forget removes the pointers to data (snapshots), making data unreachable. prune removes the data itself that is no longer reachable. Always run prune after forget to actually free storage, or use forget -prune to do both in one command.Best Practices
Use dry run first
Always preview the impact before removing snapshots:Prune regularly
Either use-prune flag or schedule regular prune runs:
Automate with cron
Schedule retention policy enforcement:Test with verbose output
Use-verbose to see exactly what’s happening:
Advanced Usage
Multiple tags
production AND important tags.
Filter by source and account
Custom grouping
Error Handling
Snapshot not found
cloudstic list to see available snapshot IDs.
Empty policy
--keep-* option.
No snapshots match filter
Related Commands
prune— Reclaim storage after forgetting snapshotslist— List all snapshots to see what’s availablebackup— Create new snapshots
See Also
- Retention Policies Guide — Design effective retention strategies
- Repository Maintenance — Best practices for long-term health
- Storage Backends — Configure where snapshots are stored