Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats a good way to rotate the logs?

good logs rotate
0
Posted

Whats a good way to rotate the logs?

0

Sending a “HUP” signal to NcFTPd isn’t necessary. Name your logs so that new logs are automatically generated according to how much information you want in the log. For example, if you want daily logs, you’d use something like “log-xfer=/var/log/ncftpd/xfer.%Y%m%d” to produce new log files each day named xfer.YYYYMMDD. Likewise, if you want hourly or monthly logs, you might use “%Y%m%d.%H” or “%Y%m” instead. Remember, you can use those date cookies anywhere in the path and NcFTPd will populate them accordingly, so you can also use these cookies to create directories as well as the file itself. If you want daily logs but only want to keep a few days worth of logs, you can write a short shell script to remove old log files and have it run from cron. Since NcFTPd doesn’t keep old log files open, you can dispose of any logs other than the current log files. For example, to remove logs older than three days, you could have the script do something like “find /var/log/ncftpd -type f -mtime +3

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.