SD_JOURNAL_GET_USAGE(3)

πŸ’– sd_journal_get_usage(3) β€” journal disk usage, bestie πŸ’–

okay so real talk: the manual page name is sd_journal_get_usage(3), and the function we're hyping is sd_journal_get_usage(). it's giving β€œhow much disk are my journal files eating?” energy, and honestly? useful. no cap. πŸ’…


✨ NAME ✨

sd_journal_get_usage β€” journal disk usage. literally that. πŸŽ€


🌸 SYNOPSIS 🌸

#include <systemd/sd-journal.h>

int sd_journal_get_usage(sd_journal *j, uint64_t *bytes);

πŸ¦‹ DESCRIPTION πŸ¦‹

sd_journal_get_usage() determines the total disk space currently used by journal files, in bytes. yes bestie, bytes. πŸ”₯

If SD_JOURNAL_LOCAL_ONLY was passed when opening the journal, this value will only reflect the size of journal files of the local host, otherwise of all hosts. simple as that, fr fr. 🫢


πŸŽ€ RETURN VALUE πŸŽ€

sd_journal_get_usage() returns 0 on success or a negative errno-style error code. that's the whole vibe check. if it's not 0, bestie, it's negative and errno-style. 😭


πŸ’œ NOTES πŸ’œ

  • all functions listed here are thread-agnostic, and only a single thread may operate on a given object at any given time. different threads may access the same object at different times. multiple independent objects may be used from different threads in parallel. 🧚
  • functions described here are available as a shared library, which can be compiled against and linked to with the libsystemd pkg-config(1) file. ✨

⭐ HISTORY ⭐

sd_journal_get_usage() was added in version 190. iconic since 190, periodt. πŸ’«


🌈 SEE ALSO 🌈


this page is brought to you by source/version systemd 261.3 and the footer’s SD_JOURNAL_GET_USAGE(3) moment β€” the date slot is empty on this one, so we’re not out here inventing dates, bestie. bye and go check your journal disk usage responsibly πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from