On Jun 2, 2015, at 4:22 PM, Mark Rivers <[email protected]> wrote:
> procServ log files sometimes get very large, so we would like to rotate them, and or delete them and start a new one without restarting the procServ process.
>
> Is this possible? I found that if I rename the log file procServ just kept writing to the renamed file. If I delete the log file procServ does not create a new one, it just silently continues without logging anything.
Hi Mark--
Since procServ has the file open, moving it won't help (procServ will continue to write to the same file handle). Likewise, trying to delete the file won't actually free up the space on disk until procServ closes the file (procServ will continue writing to the same inode which you just don't see anymore in a directory listing).
On Linux, we use logrotate to keep our procServ logs to a reasonable size. The logrotate option 'copytruncate' will do what you want (save a copy and then truncate the file being written to). If you don't have logrotate available, you can cat /dev/null on to the file to truncate it.
--
Steven Hartman
[email protected]
- References:
- Rotating or deleting procServ log files Mark Rivers
- Navigate by Date:
- Prev:
Rotating or deleting procServ log files Mark Rivers
- Next:
Re: Rotating or deleting procServ log files Wesley Moore
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Rotating or deleting procServ log files Mark Rivers
- Next:
Re: Rotating or deleting procServ log files Wesley Moore
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|