I have a Java program that needs to read from some file. The file should be created only daily and only one time. Another program creates the file. How can I check, using a shell script, that the file was created today (previous midnight/ 12 AM)?
something along the lines of
if (file created today)
// process
else
// remove old file
// create new file
// process
The examples I have seen use find command, but I already know the name of the file.
tl;dr
How can I check if file was created today in a shell script? I know the name of file.
Why not use cron to remove/create a file at midnight (if that is what you meant)?
Or
When creating the file (when it does not exist) set up at at job to delete it in 24 hours (for the other sense)?