Foldermonitor is daemon program which monitors chosen folder, reads files, parses data from it(expects one key:value data inside single file) and writes parsed data to database. Also used docker container for deploying purpose with centOS7 as base and SQLite as database.
Clone repository
git clone https://github.com/mrGoncharuk/foldermonitor.git
Build image with application
docker-compose build
Check database records
sqlite3 /home/foldermonitor/database/foldermonitor.db "select * from filedata"
If you accidentally deleted your database you can easily restore it.
cd foldermonitor/database
cat db_creation_script.sql | sqlite3 foldermonitor.db
Check log
cat /var/log/maillog
Change devtoolset(i.e to build daemon)
scl enable devtoolset-7 bash
If you don't see any logs in /var/log/maillog, restart rsyslog
systemctl restart rsyslog