compacting the notmuch database through systemd

Antoine Beaupré anarcat at orangeseeds.org
Sun Dec 1 12:52:19 PST 2019


Hi!

Thanks to Bremner, I just realized that notmuch-compact(1) is a thing,
and that thing allows me to compress my notmuch databases by about 50%.

So I whipped together two systemd units (attached) that will run that
command every month on my notmuch database. Just drop them in
`~/.config/systemd/user/` and run:

    systemctl --user daemon-reload
    systemctl --user enable notmuch-compact.timer
    systemctl --user start notmuch-compact.timer

... and you're done.

Maybe those could be shipped with the Debian package somehow? Not sure
how that works, but I think that's how gpg-agent gets started now, if
you want any inspiration...

It would be great if notmuch-new ran this on its own, when it
thought that this was "important", somehow like git-gc sometimes runs on
its own.

Of course, I suspect the 50% saving will not happen every month, but
hopefully this will keep my database size from exploding in the
future...

Finally, Bremner said that "it could make some operations slower to
compact the database, but I haven't notced that effect". That is strange
because the manpage says that compact "can both reduce the space
required by the database and improve lookup performance". ;) Hopefully,
the documentation is true and the rumors are false and the sky is not
falling and I want my mommy.

A.

PS: any humor or comedy in this email is purely accidental and shouldn't
be construed as a feeble attempt at making you smile.

-- 
I prefer the tumult of liberty to the quiet of servitude.
                        - Thomas Jefferson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20191201/25ed8f65/attachment.sig>


More information about the notmuch mailing list