[CentOS] Manually rolling logfiles over

nate centos at linuxpowered.net
Sat Jan 17 08:35:01 UTC 2009


Joseph L. Casale wrote:
> How can I do this w/o restarting services or rebooting?

copy/truncate.

copy log file to a new file and truncate the original
(cat /dev/null >filename)

Or setup a logrotate config with the copytruncate option.

There is a chance I believe to drop some log events between
the copy and the truncate depending on how active the log is.

Or use a log service such as syslog.

nate




More information about the CentOS mailing list