I am using CentOS 5.5. There is a CSV file in a particular directory(/somewhere/somefile.csv) where a software continuously appending comma separated row(s) of data time to time and the file size is growing big (currently it's 50MB+).
My idea is to create a demon to watch the CSV file. Whenever any row(s) of data appended in that CSV file the demon will read the last appended row(s) and create/write it in a separate text file by date.
I would like to know:
I have googled tons of time but didn't find any good idea/solution(s). Please help.
Thanks in advance.
asked 18 Jul '12, 03:23
You could avoid having to write any script by using Rsyslog. It allows you to use a regular file as input and write output to a file name according to a template (for example date as file name, without syslog time stamp).
answered 22 Jul '12, 03:49
I would consider using some form of source revision control like git. I think you might be able to get what you need without having to reinvent too many wheels.
answered 20 Jul '12, 11:20
You can try inotify or incron.
Starting with kernel 2.6.13, Linux provides the inotify mechanism, which allows an application to monitor file events.
or you can write your own program as described on http://www.ibm.com/developerworks/linux/library/l-ubuntu-inotify/index.html
answered 01 Aug '12, 03:33