Say I have a batch processor of a bunch of files

Say I want my processor to distinguish files that have been edited since last pass so they need to be processed again from those that haven't changed so there's no need to touch them

How could I make it distinguish such files using the file system API offered by a common Linux distribution ?

@abbienormal The find command is what you want to process files created since, modified since, etc. a given time. If the process has an output file, however, then using a makefile is easier and more robust



well, 2 observations:
yes, the process does produce output files indeed

But I'd prefer not using make

How does make achieve its thing ?

Does it store the time when it last processed a file ?


the seocnd thing: created/modified since "a given time"

I'd need read since a given time

That's -anewer instead of -mnewer with find to compare the time accessed with the output. If someone already had a process built around makefiles, they'd fake modification with touch, but find probably is the right tool. If -atime is actually the correct semantics for the job, there's no reason to really consider make there

Make compares system last modified time between the input files and an output file. This can use wildcards. It's pretty much the same as using -mnewer with find except you're not trying to fit everything on one line

So find is more powerful in a couple ways and make is less convenient to call from a cron job, but I find makefiles easier to debug

Sign in to participate in the conversation

For people who care about, support, or build Free, Libre, and Open Source Software (FLOSS).