1
2NFEXPIRE(1)               BSD General Commands Manual              NFEXPIRE(1)
3

NAME

5     nfexpire — manage expiration of flow files based on time or volume.
6

SYNOPSIS

8     nfexpire -l directory
9     nfexpire -r directory
10     nfexpire -e directory [-s maxsize] [-t maxlife] [-w watermark]
11              [-T runtime]
12     nfexpire -u path [-s maxsize] [-t maxlife] [-w watermark]
13

DESCRIPTION

15     nfexpire manages the expiration of netflow data files based on their
16     lifetime and/or the total volume of all flow files. The flow files are
17     usually created be any nfdump collector ( nfcapd sfcapd or nfpcapd )
18
19     nfexpire is used to setup the expire parameters (maintainance mode) or to
20     actually run the expire process (expire mode) based on these parameters.
21     The expire process can be triggered by either a cron job, by the collec‐
22     tor process itself (nfcapd, sfcapd auto expire mode), or by running
23     nfexpire manually.
24
25     nfexpire interacts with the collector, therefore it is safe to setup and
26     expire files from a directory which is used by any collector to store
27     flow files.
28
29     nfexpire stores a statistics file .nfstat in the given directory to main‐
30     tain the status and parameters. You should not modify this file manually
31     unless you know what you do. The directory argument for nfexpire corre‐
32     sponds to the -l argument on the collector comman line.
33
34     The options are as follows:
35
36     -l directory
37             List the current expire statistics from directory datadir. If
38             this is the first time nfexpire runs on this directory it auto‐
39             matically rescans the flow files first to update the statistics.
40             If this an active data directory used by any collector, the sta‐
41             tistics are updated automatically.
42
43     -r directory
44             Rescans the data directory, even if a statistics file already ex‐
45             ist. This command can be used to update the statistics after a
46             disk full event, after manually changing the compression of the
47             files, or if files have beed deleted manually or manipulated oth‐
48             erwise.
49
50     -e directory
51             Expire data files according to the parameters maxsize and
52             maxlife.  The expire parameters are taken from the statfile, if
53             they were previously set with -u or they can be overwritten with
54             the additional options -s -t and -w.  Files are deleted from the
55             oldest towards the latest according both limits and stops at the
56             watermark below the limit.
57
58     -u directory
59             Updates the expire parameters such as size and lifetime limits,
60             specified by -s -t and -w and stores them in the statfile as de‐
61             fault values. Any running collector process in auto expire mode
62             will take these new values starting with the next expire cycle.
63             Running nfexpire the next time in expire mode will take these new
64             parameters unless they will be overwritten by the arguments -s -t
65             and -w.
66
67     -s maxsize
68             This option sets the max size limit for all data files.  maxsize
69             accepts values such as 100M, 100MB 1G 1.5G (number + quantity
70             factor) etc. Accpeted size factors are K, KB, M, MB, G, GB and T,
71             TB. If no factor is given, bytes (B) is assumed.  A value of 0
72             disables the max size limit.
73
74     -t maxlife
75             This option sets the max lifetime for the data files.  maxlife
76             accepts values such as 31d, 240H 1.5d (number + quantity factor)
77             etc. Accpeted time factors are w (weeks) d (days) H (hours). If
78             no factor is given, hours (H) is assumed.  A value of 0 disables
79             the max lifetime limit.
80
81     -w watermark
82             This options sets the water mark in % of any limit. It applies to
83             both limits maxsize and maxlife.  The expire process is triggered
84             if any of the limits are hit and stops, if the new value reaches
85             the watermark level in % of the limit. This means files are al‐
86             lowed to grow between watermark % lower level and 100% upper
87             level. The default for watermark is 95%.
88
89     -T runtime
90             This option forces nfexpire to end the expire task after runtime
91             seconds, even if the task is not yet completed.  nfexpire updates
92             the statistics and exists cleanly, so it will pick up next time
93             where it left.  By default nfexpire runs until the task is done.
94
95     -p      This option puts nfexpire in profile mode. Only legacy NfSen will
96             need this option.
97
98     -Y      This option prints a NfSen compatible statistic. Only legacy Nf‐
99             Sen will need this option.
100
101     -h      Print help text on stdout with all options and exit.
102

RETURN VALUES

104     nfexpire returns 0 on success and 255 otherwise.
105

SEE ALSO

107     nfdump(1) nfcapd(1) sfcapd(1)
108
109BSD                            February 6, 2023                            BSD
Impressum