1# archive-logs 2 3Iteratively archive newline separated log files. 4 5## Status 6 7I actively use this software for archiving [hii][hii github] chat logs. 8For this purpose it currently works entirely fine as is. 910## Usage Example1112Consider the file `/var/log/messages` with the following content:1314 Jun 2 10:27:05 somehost syslog.info syslogd exiting15 Jun 2 10:28:05 somehost syslog.info syslogd started1617Running `archive-logs -k 50 /var/log /mnt/nfs/archive/logs` will18cause 50% of the data in `/var/log/messages` to be retained and the19other 50% to be archived in `/mnt/nfs/archive`. The utility will only20archive old data. As such, a file called `/mnt/nfs/archive/messages`21will exist after the invocation with the following content:2223 Jun 2 10:27:05 somehost syslog.info syslogd exiting2425The existing log file `/var/log/messages` will be truncated to only26store recent data, i.e. its content will be the following:2728 Jun 2 10:28:05 somehost syslog.info syslogd started2930## Installation3132The software can be compiled using:3334 make3536The software makes heavy use of the Linux `sendfile(2)` system call. If37this system call is available it is highly desirable to compile with38`HAVE_SENDFILE=1`. By default a compatibility function is used which39emulates the sendfile system call in userland.4041After compilation, tests can be run using:4243 make check4445The software can be installed globally using:4647 make install4849## License5051This program is free software: you can redistribute it and/or modify it52under the terms of the GNU General Public License as published by the53Free Software Foundation, either version 3 of the License, or (at your54option) any later version.5556This program is distributed in the hope that it will be useful, but57WITHOUT ANY WARRANTY; without even the implied warranty of58MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General59Public License for more details.6061You should have received a copy of the GNU General Public License along62with this program. If not, see <http://www.gnu.org/licenses/>.6364[hii github]: https://github.com/nmeum/hii