Once you save the script, provide executable permission to run the script.
$ chmod +x DirStatInfo.sh
HOW TO USE BASH SCRIPT WITH THE CRON:
Now add this script into cron so the script will check the directory ModifyTime after every 30 minutes.
You can change the cron time according to your requirement.
30 * * * * root /bin/bash DirStatInfo.sh
Save and close the file.
This is well-tested script and provides you data without using more memory on the server.
You can modify above script according to your requirement. If you still face any issues to setup this script then comment down below in comment box.
Stay connected & subscribe with techthings.org for more such articles.