0

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?

CEamonn
  • 853
  • 14
  • 37
  • Fake it. Setup a cron to move *.txt to were you want the files to be. You probably do not need sub-second execution for logs anyway, – Nic3500 May 12 '23 at 03:41

0 Answers0