如何编译安装cronolog?

编译安装

1 基础知识

一般情况下程序输出日志月累会有日志文件过大问题,所以衍生出日志切割工具,“cronolog”是其中一种简单的日志切割工具(笔者更加推荐使用logrotate)。
另外,由于该项目更新缓慢,所以本章只简单记录编译安装的方法,并不做过多的研究。

2 最佳实践

2.1 环境信息

OS = CentOS 8.0 x86_64
IP Addresses = any.cmdschool.org
Host Name = any

2.2 安装编译工具

yum -y install gcc gcc-c++ make expat-devel autoconf

2.3 下载软件包

cd ~
wget https://codeload.github.com/fordmason/cronolog/zip/master

2.4 解压软件包

cd ~
unzip cronolog-master.zip

2.5 预编译软件包

cd ~/cronolog-master/
./configure

如有如下错误提示,

configure: error: cannot find sources (bootstrap) in . or ..

可使用如下命令方法解决,

cd ~/cronolog-master/
ln -s configure.ac bootstrap

2.6 编译软件包

make

2.7 安装软件包

make install

2.8 测试安装的软件包

cronolog -h

可见如下提示,

usage: cronolog [OPTIONS] logfile-spec

   -H NAME,   --hardlink=NAME maintain a hard link from NAME to current log
   -S NAME,   --symlink=NAME  maintain a symbolic link from NAME to current log
   -P NAME,   --prev-symlink=NAME  maintain a symbolic link from NAME to previous log
   -l NAME,   --link=NAME     same as -S/--symlink
   -h,        --help          print this help, then exit
   -p PERIOD, --period=PERIOD set the rotation period explicitly
   -d DELAY,  --delay=DELAY   set the rotation period delay
   -o,        --once-only     create single output log from template (not rotated)
   -x FILE,   --debug=FILE    write debug messages to FILE
                              ( or to standard error if FILE is "-")
   -a,        --american         American date formats
   -e,        --european      European date formats (default)
   -s TIME,   --start-time=TIME   starting time
   -z TZ,     --time-zone=TZ  use TZ for timezone
   -V,        --version       print version number, then exit

参阅文档
=========================

github官方地址
—————
https://github.com/WayneD/cronolog

故障处理
————–
https://github.com/fordmason/cronolog/issues/3

没有评论

发表回复

编译安装
如何编译安装ifstat?

1 前言 一个问题,一篇文章,一出故事。 生产上的老旧服务器RHEL 5没有ifstat的rpm包, …

编译安装
如何安装GNU编译器gcc和g++?

1 基础知识 1.1 GNU Compiler Collection的简介 – GCC原 …

Sendmail
如何编译安装Sendmail?

1 Sendmail的简介 – Sendmail是一种重要的邮件传输代理程序(MTA即M …