# mkdir -p /usr/local/
|
# ./configure --prefix=/usr/local/
|
# make
|
# make check
# make install
|
# cd /usr/local/sbin
# ./cronolog -V
cronolog version 1.6.2
|
# ./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, --start-time=TIME starting time
-z TZ, --time-zone=TZ use TZ for timezone
-V, --version print version number, then exit
|
# export MANPATH=$MANPATH:/usr/local/cronolog/man
# man cronolog
... ...
|
/usr/local/sbin/cronolog 爲
cronolog安裝後的路徑。
|
/data/logs/ 爲日誌分割時候日誌保存位置。
|
access_log.%Y%m%d 爲日誌文件的名稱格式,天天一個文件。
|
# nohup ./deploy.sh >> ./log/deploy.log &
|
# nohup ./deploy.sh | /usr/local/sbin/cronolog "./log/deploy.logdeploy_%Y%m%d.log" &
|