NOTMUCH-COMPACT(1)

πŸ’… NOTMUCH-COMPACT(1) β€” the notmuch manual, bestie edition πŸŽ€

okay so like. this is the page for notmuch-compact, and it lives in the notmuch manual. yes it's a real whole manual. no I will not be normal about it.


✨ NAME ✨

notmuch-compact β€” compact the notmuch database


πŸ¦‹ SYNOPSIS πŸ¦‹

notmuch compact [--quiet] [--backup=<directory>]

πŸ’– DESCRIPTION πŸ’–

so the compact command? it compacts the notmuch database. that's it, that's the vibe. and the glow-up is real: it can both shrink how much space the database is eating and make lookups faster. it's giving "spring cleaning but for your mail index". 🧹✨

the compacted database gets built in a temporary directory, and then it's moved into the place of the original database. the original uncompacted database? discarded. gone. bye. unless you use the --backup=<directory> option, in which case you keep it. 🫢

heads up bestie: the database write lock is held for the entire compaction process. and that process "may be quite long". so like, protect data integrity and all, but nobody else is writing while this is happening. plan accordingly. 😭

supported options for compact include:

  • --backup=<directory> β€” save the current database into the given directory before replacing it with the compacted database. two rules though, no cap: the backup directory must not exist, and it must live on the same mounted filesystem as the current database. πŸ‘‘
  • --quiet β€” do not report database compaction progress to stdout. silent mode. stealth mode. 🀫

🌸 SEE ALSO 🌸

notmuch, notmuch-count, notmuch-dump, notmuch-hooks, notmuch-insert, notmuch-new, notmuch-reply, notmuch-restore, notmuch-search, notmuch-search-terms, notmuch-show, notmuch-tag

(go read them, they're all part of the squad πŸ’œ)


πŸ‘‘ Author πŸ‘‘

Carl Worth and many others


2009-2026, Carl Worth and many others


and that's the whole page, periodt πŸ’… this was version 0.40, dated Jan 31, 2026, coming at you straight from the notmuch source. now go compact something, bestie β€” responsibly. πŸ¦‹πŸ’–

πŸ“¦ where this page comes from