Checking directories modification dates
Im tearing my hair out witgh this one. I have a directory which copies over new directories into it every night. I need to check these exist and they were created in the last 24 hours.
So far I can check the directories exist but not their mod dates:
for dir in directory1 directory2 directory3
do
printf "checking $dir..."
if test -d "$dir"; then
printf "OK\n"
else
printf "$die, Directory not there.\n"
fi
done
I have tried using find but is plus mtime but it searches the sub directories and usually missed the intended directory.
Any ideas?
|