NFEXPIRE(1)
π
nfexpire β the nfexpire(1) glow-up π
okay so bestie, welcome to nfexpire, a Gen Zβapproved member of the General Commands Manual squad β¨. It's the little tool that decides when your netflow files have β¨lived their best lifeβ¨ and gotta go. Let's get into it π¦
β¨ NAME β¨
nfexpire β lowkey the manager of flow-file expiration, based on time or volume. it's giving "declutter queen" π
πΈ SYNOPSIS πΈ
nfexpire -l directory
nfexpire -L directory
nfexpire -r directory
nfexpire -e directory [-s maxsize] [-t maxlife] [-w watermark]
[-T runtime]
nfexpire -u path [-s maxsize] [-t maxlife] [-w watermark]
π«Ά DESCRIPTION π«Ά
so nfexpire handles the expiration of netflow data files based on their lifetime and/or the total volume of all flow files. those flow files are usually created by any nfdump collector (nfcapd, sfcapd, or nfpcapd) β iykyk π«
nfexpire is the tool you use to set up the expire parameters (that's maintenance mode) or to actually run the expire process (that's expire mode) based on those parameters. and the expire process can be triggered three ways, bestie:
- by a cron job,
- by the collector process itself (
nfcapd,sfcapdauto expire mode), - or by running
nfexpiremanually.
nfexpire interacts with the collector, so it's literally safe to set up and expire files from a directory that any collector is using to store flow files. no cap π§
it also stores a statistics file .nfstat in the given directory to maintain the status and parameters. β οΈ you should not modify this file manually unless you know what you're doing β that's a whole main-character risk you don't need π
and heads up: the directory argument for nfexpire corresponds to the -l argument on the collector command line. match them up, slay π₯
the options are as follows:
π OPTIONS π
-l directoryβ lists the current expire statistics fromdirectorydatadir. if this is the first timenfexpireruns on this directory, it automatically rescans the flow files first to update the statistics. and if this is an active data directory used by any collector, the statistics get updated automatically π-L directoryβ lists current expiration statistics and the bookkeeping records for directory. the deluxe version, periodt π-r directoryβ rescans the data directory, even if a statistics file already exists. use this to update the statistics after a disk full event, after manually changing the compression of the files, or if files have been deleted manually or manipulated otherwise. the "refresh my memory" option π§ β¨-e directoryβ expire data files according to the parameters maxsize and maxlife. the expire parameters are taken from the statfile if they were previously set with-u, or they can be overwritten with the additional options-s,-t, and-w. files are deleted from the oldest towards the latest according to both limits, and it stops at the watermark below the limit. bye bye old files ππ-u directoryβ updates the expire parameters (size and lifetime limits) specified by-s,-t, and-w, and stores them in the statfile as default values. any running collector process in auto expire mode will take these new values starting with the next expire cycle. and runningnfexpirethe next time in expire mode will take these new parameters β unless they get overwritten by the arguments-s,-t, and-wπ-s maxsizeβ sets the max size limit for all data files. maxsize accepts values such as100M,100MB,1G,1.5G(number + quantity factor) etc. accepted size factors areK,KB,M,MB,G,GB, andT,TB. if no factor is given, bytes (B) is assumed. a value of0disables the max size limit π«-t maxlifeβ sets the max lifetime for the data files. maxlife accepts values such as31d,240H,1.5d(number + quantity factor) etc. accepted time factors arew(weeks),d(days),H(hours). if no factor is given, hours (H) is assumed. a value of0disables the max lifetime limit β³-w watermarkβ sets the water mark in % of any limit. it applies to both limits, maxsize and maxlife. the expire process is triggered if any of the limits are hit, and stops if the new value reaches the watermark level in % of the limit. meaning: files are allowed to grow between the watermark % lower level and the 100% upper level. default for watermark is95%π§-T runtimeβ forcesnfexpireto end the expire task after runtime seconds, even if the task is not yet completed.nfexpireupdates the statistics and exits cleanly, so it will pick up next time where it left off π«Ά by defaultnfexpireruns until the task is done.-pβ putsnfexpirein profile mode. only legacy NfSen will need this option π§-Yβ prints a NfSen compatible statistic. only legacy NfSen will need this option π§-hβ prints help text on stdout with all options and exits. our fave, the "wait what does this do again" button π
π EXIT STATUS π
nfexpire returns 0 on success and 255 otherwise. that's it. that's the whole vibe check β
β
π SEE ALSO π
nfcapd(1), nfdump(1), sfcapd(1) β go say hi to the rest of the family bestie π¦
β¨ and that's the whole page, no skips, no summaries, we ate and left no crumbs π π
mwah π this cutie came from the Debian fam with a date of $Mdocdate$ β see u in the group chat, bestie π
π¦ where this page comes from
- epel 10: nfdump 1.7.10-1.el10_3 Β· BSD-3-Clause AND GPL-2.0-or-later
- Copyright (c) 2022, Peter Haag
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms