Skip to content
/ retail Public
forked from mbucc/retail

A stateful tail that recognizes log rotations.

Notifications You must be signed in to change notification settings

jtobey/retail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RETAIL(1)                 BSD General Commands Manual                RETAIL(1)

NAME
     retail -- display the additions to a file since previous retail run

SYNOPSIS
     retail [-o datafile] file

DESCRIPTION
     The retail utility displays the lines added to file since the last run to
     stdout.

     After each run, the retail utility stores the most recent size, byte off-
     set and inode of file. By default, this information is stored in the same
     directory as file and with the same name as file except with the prefix
     ``offset.'  For example, if the file is ``syslog'', the offset data will
     be stored in a file named ``offset.syslog''.

     The utility accepts one option:

     -o datafile
          The datafile option lets you specify where to store the data from
          the last run.  If the option specifies a file, the data is stored in
          that file.  If a directory, the data is stored in that directory,
          using the default file name described above.

     In some cases, retail will notice that the file has been rotated and tail
     the rotated file before tailing the current file.

     Specifically, if the inode of the file is unchanged and the file is
     smaller, retail assumes the file was rotated via a copy and truncate.
     The utility looks for files (in the same directory) that match the file
     name and takes the most recently modified one.  For example, if the file
     name is ``syslog'', and the same directory has the files ``syslog.1'' and
     ``syslog.2'', retail will assume the most recently modified of the two is
     the rotated file.

     If the inode is different, retail assumes the file was rotated via a move
     and recreate, and looks for a file with the old inode.  If it can't find
     one, retail assumes the old file was gzipped after the move and looks for
     the most recently changed file in the same directory with a name that
     starts with the file name and ends with ``.gz''.

     If neither of these conditions apply, then retail does not try to find a
     rotated file.

EXIT STATUS
     The retail utility returns 0 on success and 1 if an error occurs.

EXAMPLES
     To retail syslog and store the offset data in ``/var/db/retail/off-
     set.syslog''.

           $ retail -o /var/db/retail/ /var/log/syslog

SEE ALSO
     tail(1), http://sourceforge.net/projects/logtail-v3/,
     http://ranum.com/security/computer_security/code/index.html

HISTORY
     Initially published by Craig H. Rowland in 1996.  He got the idea from
     the retail utility, which came with Trusted Information Systems' Gaunt-
     let(TM) firewall protection package.

BSD                            December 27, 2014                           BSD

About

A stateful tail that recognizes log rotations.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 66.1%
  • Shell 22.3%
  • Makefile 11.4%
  • Prolog 0.2%