Solved newsyslog manual log rotation

Has anyone done this? It seems simple enough in that you use the "-R" flag followed by a filename, but apparently, I'm missing something:

Code:
root@freebsdhost:/var/log # newsyslog -R /var/log/httpd-ssl_request.log
newsyslog: At least one filename must be given when -R is specified.
usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]
  [-S pidfile] [-t timefmt] [[-R tagname] file ...]

I get the same error message when using just the filename (as opposed to an absolute path), single quotes, and double quotes. There is definitely an entry for the filename in /etc/newsyslog.conf. Am I running the command incorrectly?

My OS is FreeBSD 10.1. I want to rotate manually this log file because I had to reconfigure the log entry format to provide www/awstats the necessary data, and www/awstats won't read the current log file because older entries still have the old log format.
 
Look at the help output for -R. You are missing the tagname which gets put into the newly created logfile.

# newsyslog -R "Log file rotated" /var/log/httpd-ssl_request.log

It's also mentioned in the blurb for -R in the man page. When in doubt, always read the man page. ;)
 
Believe it or not, I did read the man page (always my first source), but for whatever reason, my brain saw "tagname" and said, "Oh, that's optional." *facepalm*

A second pair of eyes, especially when they're not tired like mine, is always helpful. Thanks! :)
 
Back
Top