I am trying to rotate a log file using logrorate
. Following is the configuration:
/etc/logrotate.conf:
/var/log/test.log {
size 1M
rotate 6
create
dateext
nocompress
}
Then I dump some data using seq
command to /var/log/test.log
, but the file is not being rotated automatically.
ls -ltrh test.log
-rw-r--r-- 1 root root 1.3M Jan 27 09:56 test.log
When I try to rotate it forcefully using logrotate -f test.log
, the output would be:
error: test.log:37156 lines must begin with a keyword or a filename (possibly in double quotes)
error: test.log:37157 lines must begin with a keyword or a filename (possibly in double quotes)
error: test.log:37158 lines must begin with a keyword or a filename (possibly in double quotes)
error: test.log:37159 lines must begin with a keyword or a filename (possibly in double quotes)
Suggest if any corrections needed.