0

I have directory, that gets new .gz files during the day. I'd like to have a scripts that I start in the morning, and which keeps reading the data (and possibly processing it) as the new files are added. What would be the cleanest way to do it?

4
  • 5
    Use something based on inotify if you are on Linux, or equivalent elsewhere. See stackoverflow.com/a/18692191 Jan 26, 2018 at 19:09
  • also unix.stackexchange.com/questions/24952/…
    – steve
    Jan 26, 2018 at 19:16
  • @PatrickMevzek I'm hoping for a simpler solution, since I just need to read the files. Like if I execute 'awk '{}' the script will just keep reading the input. I want a similar functionality
    – LazyCat
    Jan 26, 2018 at 19:20
  • 1
    See @steve reference: inotifywait -m /path -e create | while read path action file; do process "$file" ; done where process is your processing part. Put all of it in a file, add execute bits, and start it in the morning. Jan 26, 2018 at 19:22

0

You must log in to answer this question.

Browse other questions tagged .