Mention .partial objects in the help and config init text

prune --help, remote info --help, the snapshot create --prune flag, the
config init template's prune_grace_period comment and the
runPostBackupPrune comment each listed what prune deletes or remote info
counts, and none named the .partial objects this change adds. They do
now; the --prune flag refers to prune instead of repeating its list.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-19 07:47:00 +00:00
1 parent 332c2d30a2
commit 92296daf52
5 files changed
+22 -19

No files matched your search

+5 -3
View File
@@ -269,9 +269,11 @@ storage_url: ""
# How old a blob that no snapshot lists must be before prune deletes it, # How old a blob that no snapshot lists must be before prune deletes it,
# and how old every object in a directory under metadata/ with no manifest # and how old every object in a directory under metadata/ with no manifest
# must be before prune deletes that directory. A backup uploads its blobs # must be before prune deletes that directory. prune also deletes a
# and its db.zst.age before its manifest, so on a destination shared # .partial object left by a killed upload only once it is this old. A
# between hosts or users this must be longer than the longest backup run. # backup uploads its blobs and its db.zst.age before its manifest, so on
# a destination shared between hosts or users this must be longer than
# the longest backup run.
# It does not protect a blob a backup reuses from an earlier run that # It does not protect a blob a backup reuses from an earlier run that
# stopped before its manifest: that blob keeps the time of its first # stopped before its manifest: that blob keeps the time of its first
# upload, so a prune can delete it. # upload, so a prune can delete it.
+6 -4
View File
@@ -13,9 +13,10 @@ func NewPruneCommand() *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "prune", Use: "prune",
Short: "Tidy local database and remote storage", Short: "Tidy local database and remote storage",
Long: `Removes orphaned data from the local index database, and Long: `Removes orphaned data from the local index database. From the
unreferenced blobs and directories under metadata/ with no manifest backup destination store it removes unreferenced blobs, directories
from the backup destination store. under metadata/ with no manifest, and .partial objects left by killed
uploads.
Local cleanup drops incomplete snapshots and any files, chunks, or Local cleanup drops incomplete snapshots and any files, chunks, or
blobs no longer referenced by a completed snapshot. Remote cleanup blobs no longer referenced by a completed snapshot. Remote cleanup
@@ -30,7 +31,8 @@ blob keeps the time of its first upload, so it can be deleted.
Remote cleanup also deletes each directory under metadata/ with no Remote cleanup also deletes each directory under metadata/ with no
manifest, as a backup that stopped before its manifest leaves, once manifest, as a backup that stopped before its manifest leaves, once
all its objects are older than prune_grace_period and its snapshot is all its objects are older than prune_grace_period and its snapshot is
not in the local index. not in the local index. It also deletes each .partial object under
metadata/ or blobs/ once it is older than prune_grace_period.
Snapshot create --prune runs the same cleanup automatically; this Snapshot create --prune runs the same cleanup automatically; this
command is the manual entry point for the same work (e.g. after a command is the manual entry point for the same work (e.g. after a
+2 -1
View File
@@ -75,7 +75,8 @@ func newRemoteInfoCommand() *cobra.Command {
- Size of all snapshot metadata (per snapshot and total) - Size of all snapshot metadata (per snapshot and total)
- Count and total size of all blobs - Count and total size of all blobs
- Count and size of referenced blobs (from all manifests) - Count and size of referenced blobs (from all manifests)
- Count and size of orphaned blobs (not referenced by any manifest)`, - Count and size of orphaned blobs (not referenced by any manifest)
- Count and size of .partial objects left by killed uploads`,
Args: cobra.NoArgs, Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error { RunE: func(cmd *cobra.Command, _ []string) error {
// Use unified config resolution // Use unified config resolution
+5 -7
View File
@@ -138,13 +138,11 @@ on Linux), then /etc/vaultik/config.yml.`,
cmd.Flags().BoolVar(&opts.Cron, "cron", false, cmd.Flags().BoolVar(&opts.Cron, "cron", false,
"Run in cron mode (silent unless warning or error)") "Run in cron mode (silent unless warning or error)")
cmd.Flags().BoolVar(&opts.Prune, "prune", false, cmd.Flags().BoolVar(&opts.Prune, "prune", false,
"After backup, drop older snapshots of the same name, remove "+ "After backup, drop older snapshots of the same name, then delete "+
"orphaned blobs older than prune_grace_period, and delete each "+ "from the destination store what prune deletes there (not "+
"directory under metadata/ with no manifest once all its "+ "after a backup that skipped unreadable files, found a "+
"objects are older than prune_grace_period and its snapshot is "+ "configured path empty, or did not find a mount point an "+
"not in the local index (not after a backup that skipped "+ "earlier snapshot found)")
"unreadable files, found a configured path empty, or did not "+
"find a mount point an earlier snapshot found)")
cmd.Flags().StringVar(&opts.KeepNewerThan, "keep-newer-than", "", cmd.Flags().StringVar(&opts.KeepNewerThan, "keep-newer-than", "",
"With --prune: keep snapshots newer than this duration "+ "With --prune: keep snapshots newer than this duration "+
"(e.g. 30d, 4w, 6mo, 1y; m is minutes, mo is months) "+ "(e.g. 30d, 4w, 6mo, 1y; m is minutes, mo is months) "+
+4 -4
View File
@@ -302,10 +302,10 @@ func (v *Vaultik) snapshotNamesToCreate(requested []string) ([]string, error) {
} }
// runPostBackupPrune drops older snapshots of the given names and removes // runPostBackupPrune drops older snapshots of the given names and removes
// from remote storage the orphan blobs and the directories under // from remote storage the orphan blobs, the directories under metadata/
// metadata/ with no manifest, as PruneBlobs does. If keepNewerThan is set // with no manifest and the `.partial` objects, as PruneBlobs does. If
// (e.g. "4w"), snapshots newer than that duration are kept. Otherwise only // keepNewerThan is set (e.g. "4w"), snapshots newer than that duration are
// the latest snapshot of each name is kept. // kept. Otherwise only the latest snapshot of each name is kept.
func (v *Vaultik) runPostBackupPrune( func (v *Vaultik) runPostBackupPrune(
snapshotNames []string, keepNewerThan string, snapshotNames []string, keepNewerThan string,
) error { ) error {