spaceman.cf
Defines how the space manager expires old data.
File Location
$NFRHOME/etc/spaceman.cf
Comments
Any characters after a '#' and until a '\n', are considered a comment. Blank
lines are also ignored.
Line Continuation
To continue a long line, use the character '\' at the end of the first line and use
white space (spaces or tabs) at the beginning of the next line. For example:
R:webwatcher/urlhist:1m::7:Process+Purge:\
/bin/mail -s 'URL History for %M %y" %f::
Syntax
TYPE:backend/recorder:QUOTA:AGE:PRIORITY:ACTION:COMMAND:LOCATION:
TYPE:directory:QUOTA:AGE:PRIORITY:ACTION:COMMAND:LOCATION:
Fields
In all cases there must be the complete 8 set of fields even if one is empty.
- TYPE - The type of configuration entry. This field is
required. Valid values are:
- R - backend/recorder
- D - directory to monitor
- backend/recorder - The name of the backend and
recorder combination for or which this entry applies. You must specify both the
backend and the recorder. If you are creating an entry to manage space for a
backend, this field is required.
- directory - The directory for which this entry applies.
If you are creating an entry to manage space for a particular directory, this field is
required.
- QUOTA - The maximum amount of disk space that the space
manager can use for the archived database for this recorder. You must specifiy a
QUOTA or an AGE, and you can specify both. Valid abbreviations for disk size are:
- K - kilobytes
- M - megabytes
- G - gigabytes
- AGE - The maximum amount of time that the space manager should
keep archived data for this recorder. You must specifiy a QUOTA or an AGE, and you
can specify both. Valid abbreviations for time units are:
- m - minutes
- h - hours
- d - days
- w - weeks
- PRIORITY - The level of importance for this entry, indicating
the data sets that are the most important to keep the longest. The space manager
only uses this setting when disk space becomes limited. This field is required.
When available space becomes limited and may begin affecting operations, the space
managemer begins expiring of data earlier than the configuration file for that backend
indicates that it should be expired. This ensures that the system has enough space
to continue operations. The space manager uses the PRIORITY of each entry to
determine which data to expire first. When the space manager has cleared enough disk
space, space manager stops this early expire process. The space manager logs
all actions. Valid priority levels are:
- 10 - highest priority. The space manager expires this data first.
- through
- 0 - lowest priority. The space manager expires this data last.
- ACTION - The type of action that the space management system
should take when data is to be expired. This field is required. Valid values
are:
- None - Do not expire this file. This file is exempt from
expiration.
- Purge - Remove the file from the disk.
- Save - Save the file to external media prior to removal. Save
implies purging of data after external storage
- Process - Send the data for processing to a program outside of the
space management system. If you use this value, you must specify a COMMAND.
If you want to remove the data, your external program must remove the data or you
must use the Process+Purge or Process+Save action.
- Process+Purge - Sends the data for processing to a program outside the
space management system. When the program completes, the space manager removes the
data. If you use this value, you must specify a COMMAND
- Process+Purge - Sends the data for processing to a program outside the
space management system. When the program completes, the space saves the data to the
external media, and then removes the data. If you use this value, you must specify a
COMMAND.
- COMMAND - The command line that the space manager executes to
process data. This field is required if you use any Process action. Valid
substitutions within the command are:
- %b - name of backend with which the file was archived
- %d - two digit day of month (1-28/30/31)
- %f - name of file being expired
- %F - full path to the file being expired
- %m - two digit month of year (1-12)
- %r - name of recorder with which the file was archived
- %y - four digit year (1990,..2001)
- %D - Day of the week (Sunday, Monday, ..)
- %M - Month of year (January, February, ..)
You can setup the command as either a 'filter' or as a standalone command line to be
executed. If you specify a '|' (pipe) symbol as the first character of a command then the
file is sent to the command on standard input. If you do not specify the '|' symbol, then
the command you have specified is simply executed.
- LOCATION - The location of the external media where the space
manager saves files. This field is required if you use any Save action. The
location can be an external media source or an NFS-mounted drive. Valid
substitutions within the location are:
- %b - name of backend with which the file was archived
- %d - two digit day of month (1-28/30/31)
- %f - name of file being expired
- %F - full path to the file being expired
- %m - two digit month of year (1-12)
- %r - name of recorder with which the file was archived
- %y - four digit year (1990,..2001)
- %D - Day of the week (Sunday, Monday, ..)
- %M - Month of year (January, February, ..)
Example
#
#---------------------------
# Backend/Recorder Samples:
#---------------------------
# The data in these examples would be created by recorders using the
# NFR archive library. There is an associated index file that is read
# as input to the expiration process.
#
#R:backend/recorder:QUOTA:AGE:PRIORITY:ACTION:COMMAND:LOCATION:
#---------------------------------------------------------------
#
R:firewall/test::1w:7:Save::/tmp/data/%b/%y/%m/%d/%f:
R:mail/bulk:1g:1w:5:Save::/Bigdisks/1/%b/%y/%m/%d/%f:
R:mail/od:1g:1w:5:Save::/Bigdisks/1/%b/%y/%m/%d/%f:
R:web/watchservers:1M:1m:5:Save::/SOME_DISK_LOCATION/1/%b/%m/%d/%f:
R:web/detect:1m::7:Process+Purge:\
/bin/mail -s 'URL History for %M %y' LOCAL_ADMIN::
R:mark/newip:400K:5w:7:Process+Purge:| /bin/gzip -c -9 > \
/tmp/data/%b/%m%d%y.%f.gz::
R:mark/od:400K:5w:7:Process+Purge:| /bin/gzip -c -9 > \
/tmp/data/%b/%m%d%y.%f.gz::
R:network/tcp::1w:7:Process+Purge:\
/home/kent/spaceman/spacemand/tarfile /tmp/data/%b/%m%d%y.tar %F::
R:network/udp::1w:7:Process+Purge:\
/home/kent/spaceman/spacemand/tarfile /tmp/data/%b/%m%d%y.tar %F::
R:network/tcppackets::1w:7:Process+Purge:\
/home/kent/spaceman/spacemand/tarfile /tmp/data/%b/%m%d%y.tar %F::
#
#----------------------------
# Directory Location Samples:
#----------------------------
#
#The data in these examples would be created outside of the NFR system
#and would not have used the NFR archive library. There is no associated
# index. This method reads the directory and decides what files are due
# to expire based on file times and sizes.
#
#D:directory-location:QUOTA:AGE:PRIORITY:ACTION:COMMAND:LOCATION:
#-------------------------------------------------------------------
#
D:/var/log/syslogs/:10M:4w:8:Process+Purge:| logreport | /usr/local/bin/elm \
-s 'Syslog Reporting for %y/%m/%d' admin-reports::
|