I'd like inotifywait to detect whenever a file is uploaded/modified to the Data directory on my server, and make sure the entire folder (including any subdirectories created during the upload) are set to have 755 status.
This script seems to detect activity, but does not run the chmod command:
#!/bin/bash
while inotifywait -m -r /home/tr/Data; do
chmod -r /home/tr/Data
done
