I'm writing a script to
stat all files in a directory, and then find specific files that were created yesterday and tell me if they are larger than a certain size or not.
So basically I need this to find that file, which is a .gz type file (and should have been last modified at least 24 hours ago) and have it check its size to make sure it's not under a certain number, say 4 kilobytes for example. And if it is, under that 4 kilobyte size, it needs to echo "Failure" or something like that, and if it was above that threshold, it needs to echo "Success" or something similar.
Eventually I'll have it send an email if it was a fail or success.
So far I have it stating all the files and finding the ones that have been modified in the last 24 hours, but since I'm such a newby, I'm lost at this point:
for file in /*; do stat $file done find /* -mtime -1 -print
I have this running my whole computer right now, but it will eventually be ran on a specific directory.