1.Dd $Mdocdate: June 14 2020 $ 2.Dt ARCHIVE-LOGS 1 3.Os 4.Sh NAME 5.Nm archive-logs 6.Nd archive newline separated log files 7.Sh SYNOPSIS 8.Nm archive-logs 9.Op Fl e Ar pattern10.Op Fl k Ar percentage11.Ar current12.Ar archive13.Sh DESCRIPTION14The15.Nm16utility copies newline separated log data from a17.Ar current18logging directory to an19.Ar archive20directory.21The utility iterates over all regular files in the current directory.22A configurable percentage of lines is retained in the iterated files.23The remaining lines are appended to equally named files in the archive and24erased from the files in the current directory.25This property allows iteratively invoking the utility on the same pair26of directories.27.Pp28The utility operates under two central assumptions.29First, it is assumed that no other program access any files in the given30directories while31.Nm32is running.33Second, the utility assumes that log files are appended.34Based on the later assumption only older log file entries are copied to35the archive while more recent entries are retained.36.Pp37The options are as follows:38.Bl -tag -width Ds39.It Fl e Ar pattern40Exclude all files matching the given extended regular expression41.Ar pattern .42The pattern should match file paths relative to the current directory.43.It Fl k Ar percentage44Specify the45.Ar percentage46of lines to keep in the log files from the current directory.47Defaults to 50 if unspecified.48.El49.Sh EXIT STATUS50.Ex -std archive-logs51.Sh AUTHORS52.An Sören Tempel Aq Mt soeren@soeren-tempel.net53.Sh CAVEATS54The utility operates under the central assumption that no other software55accesses the files in the given directories while it is running.