How to send randomly named/created files to /dev/null?
Hi,
Was wondering if anyone can help me with sending auto-created, auto-named log files to /dev/null. I have a needed service running, but it is generating excessive log files in /var/log/share. I would normally do ln -s /dev/null logname.log, but in this case the logs would be randomly labeled like: log-test-123 log-test-456 log-sa-678 where only the first word (log) is consistently the same. Any ideas on how I can resolve this without stopping the service? Thanks! |
In my experience, log files in /var/log end in the extension .log.
My first tactic would be to look at the contents of /var/log and, if none of the log files have "log" as the first three letters of their file names, consider using wild cards as in /var/log/log*. You could test by using ls, as in Code:
ls /var/log/log* |
ok i will try it
|
|
thanks
|
of course, there's a bigger question here:
why is it creating excessive logs? why is the log rotating application, that is surely working on your system, not enough? |
its creating excessive logs due to a persistent error and it's really flooding that directory. The error fix is coming, but I just want /dev/null them. I don't believe that these are in a rotation as these logs would never normally generate at this rate. My main focus is to just get rid of them.
|
How about a cron that rm log-* every minute (or >it)
But lsof: if open, space won't be deallocated!!! https://unix.stackexchange.com/quest...hole-directory |
if they are handled by rsyslogd (or similar) you can simply filter them out. But anyway I would try to configure the app to write that errors directly into /dev/null.
|
All times are GMT -5. The time now is 08:58 AM. |