I have a script that outputs log files based on the year/month/date/time on a continuing basis with 15 minute rotations, so my directory structure looks like this
/data/logs/2023/05/10/00:00.txt
/data/logs/2023/05/10/00:15.txt
/data/logs/2023/05/10/00:30.txt
/data/logs/2023/05/10/00:45.txt.partial
The .partial file is the file that's currently being written to, the logs automatically create a new directory for each day/month/year. I want to use incron (or if there's a better option) to automatically copy each to to another destination on completion.
Is there a way to monitor the /data/logs directory with incron so it will automatically run a shell script when each file has completed writing?