Commit 0c3337e2 authored by Axel Beckert's avatar Axel Beckert

Imported Upstream version 1.1

parent 4d7c374a
This diff is collapsed.
\ No newline at end of file
# Files
SRC = since.c
OBJ = since.o
TARGET = since
MAN = since.1
BINDIR = /usr/local/bin
MANDIR = /usr/local/man/man1
# IMHO auto{make,conf} is overkill. Simple, readable makefiles improve security
# Compiler and Flags
CC = gcc
CFLAGS = -Wall -O2
RM = rm -f
INSTALL = install -c
LINK = ln -s
TOUCH = touch
TAR = tar
NAME = since
# Generic build all
all : $(TARGET)
# disable/enable as desired
CFLAGS += $(shell test -f /usr/include/sys/inotify.h && echo -DUSE_INOTIFY)
# Install
install : $(TARGET)
$(INSTALL) -m 0755 $(TARGET) $(BINDIR)
$(INSTALL) -m 0644 $(MAN) $(MANDIR)
CC = gcc
RM = rm -f
INSTALL = install -D
# Build since executable
$(TARGET) : $(OBJ)
$(CC) $(CFLAGS) $(OBJ) -o $(TARGET)
$(NAME): $(NAME).c
$(CC) $(CFLAGS) -o $@ $^
# Build object files from source
.c.o :
$(CC) $(CFLAGS) -c $*.c
install: $(NAME)
$(INSTALL) $(NAME) $(prefix)/bin/$(NAME)
$(INSTALL) $(NAME).1 $(prefix)/share/man/man1/$(NAME).1
# Remove junk
clean :
$(RM) *.o core *~
reallyclean : clean
$(RM) $(NAME) core *.o
......@@ -2,29 +2,33 @@ Since
since is a tail(1) with state - it allows the user to
view only the lines appended to a log file since the last
view only the lines appended to a file since the last
time since was used.
Installation Instructions
To build the executable type:
To copy the executable and manual page, become root and type:
To install the executable and manual page, become root and type:
make install
The default locations are:
To change the install location use the prefix variable:
make prefix=/usr install
To understand how it works run the commands:
To understand how since works run the following commands:
echo "First line" >> testlogfile
......@@ -33,10 +37,15 @@ To understand how it works run the commands:
./since testlogfile
rm testlogfile
You might want to set up the following alias:
I find it useful to add aliases such as the following to my
.bashrc file
alias dosince='since /var/log/{messages,syslog,mail.log}'
alias dosince='since /var/log/messages /var/log/xferlog'
The since homepage is
Since is released under the terms of the GNU public
license. Click accept now... errr... sorry... just
look at COPYING.
Since is released under the terms of the GNU public license
version 3 or newer, as set out in the file COPYING.
......@@ -2,92 +2,161 @@
since \- display content of a file since the last time
.B since [-hnqvx]
.B since [-aefhlmnqvxz] [-d
.IB seconds ]
.B [-s
.IB file ]
.I files
.B since
is similar to
.B tail
since it also displays the tail of a file. However
is a utility designed to monitor log files.
.B since
displays only the data which has been added since the last time
is similar to
.BR tail (2)
as it also displays information appended to a file.
.B since
was run. If
only displays the data which has been added
.I since
the last time
.B since
has not been run before the entire
file is displayed.
was run. If
.B since
is useful for watching over log files.
is run on a particular file for the first time,
then the entire file is displayed.
.B since /var/log/apache/{access,error}_log > /dev/null
.B lynx --dump http://localhost/ > /dev/null
.B since /var/log/apache/{access,error}_log
.IP -a
Make updates to the since state files atomic. This option
.B since
to use a temporary file and a
.BR rename (2)
instead of updating the state file in situ.
.IP "-d seconds"
Specify the number of integer seconds to wait between
polling files for changes. This option is only relevant
in conjunction with the
.B -f
option and if the inotify mechanism is not being used.
.IP -e
Print the header lines to standard error instead of
standard output.
.IP -f
Follow the specified files. This option is analogous to
.B "tail -f"
as the files are also polled for changes until the
process is interrupted.
.IP -h
Print a terse help message.
.IP -l
Relaxed mode. If some data files are inaccessible
.B since
will not fail completely.
.IP -m
.BR mmap (2),
.BR read (2)
instead to access state and data files.
Note that for certain smaller io operations
.BR read (2)
may be used even if this option has not been given.
.IP -n
Do not update the
.I .since
file which keeps track of file growth.
.IP -q
Decrease the verbosity of the output.
Make the utility operate more quietly.
.IP "-s filename"
Specify the state file explicitly. Using this option
will also disable the use of fallback state files.
.IP -v
Increase the verbosity of the output.
Increase the verbosity. This option can be given
multiple times.
.IP -x
Exclude files with compressed extensions.
Ignore file arguments which have compressed extensions.
.IP -z
Discard output. Similar to redirecting the
output to
.IR /dev/null ,
but faster. If used in conjunction with
.B -f
option, only the initial output will be discarded.
.I .since
File recording the length of the files displayed previously.
The location of the file can be set by using the
environment variable, for example
.B export SINCE=
.I /var/log/sincefile
will tell
State file recording the length of the previously displayed files.
The location of the file can be set on the command line
using the
.B -s
option. If this option is not given,
.B since
to use the file
.I /var/log/sincefile.
If the
will check the
environment variable for the location of
the state file. If the
environment variable has not been set
.B since
will use the
environment variable and store the information in the file
.B .since
in the directory pointed to by the variable. If neither the
nor the
variable are set
.B since
.IR $HOME/.since .
If the
variable is not set,
.B since
will use a
.BR getpwuid (3)
lookup. If all these fail
will use the file
.I /tmp/since.
.IR /tmp/since .
.B since
will break when used across NFS on architectures which have different
st_* field sizes.
.B since
uses the inode of a file as its key, if that inode is recycled
.B since
might get confused.
will get confused.
.B since
is not particularly efficient when storing the
.BI stat()
information, but should work reasonably well unless you plan to look at
thousands of files. Functionality equivalent to
is not particularly efficient when storing or looking up the
.BR stat (2)
information. Functionality equivalent to
.B since
can probably be achieved with a number of trivial
shell scripts.
.B since
may only be used, distributed and modified in accordance with
the terms of the
.B GPL (GNU General Public License)
.B GPL (GNU General Public License)
.B 3 or newer
as published by the
.B FSF (Free Software Foundation).
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment