Is it possible to centralize files in a directory? Currently, I am only using a common verisions of rsyslog. I can set the imfile for single file but it doesn't seem to work for a directory of files. Each file name has the date at the end of the file name so I can't just hardcode the name of the file in my rsyslog config.
Asked
Active
Viewed 53 times
-4
-
1What does "centralize files in a directoy" mean? Please describe your actual problem better. – Sven Apr 01 '15 at 13:47
-
@sven My take is that she has `log-20150330.txt`, `log-20150331.txt`, etc, but rsyslog only accepts absolute filenames for the text file input facility. – Hyppy Apr 01 '15 at 14:03
1 Answers
0
cat log1.txt log2.txt log3.txt > centrallog.txt
or
for FILE in `find /var/log/mylogs/ -name "somelog*" -type f -print`
do
cat $FILE >> /var/log/mylogs/biglog.txt
rm -f $FILE
done

Hyppy
- 15,608
- 1
- 38
- 59