Thursday, December 22, 2011

FreeBSD - How to test newsyslog for syntax error

Platform :
FreeBSD

Purpose :
Syntax checking after creating a new logrotate in "newsyslog"

Command :
newsyslog


Installation :
The "newsyslog" log rotation program comes with the base installation.

Useful switches :
-n // DO NOT actually do the logrotate. Instead, show what will be perform
-vv // verbose on what newsyslog is doing

Example :


FreeBSD# newsyslog -nvv
/var/log/all.log <7j>: does not exist, skipped.
/var/log/amd.log <7j>: does not exist, skipped.
/var/log/auth.log <7j>: size (Kb): 6 [100] --> skipping
/var/log/console.log <5j>: does not exist, skipped.
/var/log/cron <3j>: size (Kb): 6 [100] --> skipping
/var/log/daily.log <7j>: does not exist, skipped.
/var/log/debug.log <7j>: size (Kb): 2 [100] --> skipping
/var/log/kerberos.log <7j>: does not exist, skipped.
/var/log/lpd-errs <7j>: size (Kb): 2 [100] --> skipping
/var/log/maillog <7j>: --> will trim at Sun Jan 2 00:00:00 2011
/var/log/messages <5j>: size (Kb): 92 [100] --> skipping
/var/log/monthly.log <12j>: does not exist, skipped.
/var/log/pflog <3j>: does not exist, skipped.
/var/log/ppp.log <3j>: size (Kb): 2 [100] --> skipping
/var/log/security <10j>: size (Kb): 2 [100] --> skipping
/var/log/sendmail.st <10>: age (hr): 1 [168] --> skipping
/var/log/weekly.log <5j>: does not exist, skipped.
/var/log/wtmp <3>: --> will trim at Tue Feb 1 05:00:00 2011
/var/log/xferlog <7j>: size (Kb): 2 [100] --> skipping

After adding or changing entries in newsyslog.conf, is good to run this test to check out any errors in the configuration file.

Das Vidanya !!!

Reference:
http://scratching.psybermonkey.net/2011/01/freebsd-how-to-test-newsyslog-for.html

No comments: