Article 5FS29 Checking permissions of files under a folder

Checking permissions of files under a folder

by
TravisBrooker
from LinuxQuestions.org on (#5FS29)
Dear all,
i would like to put a script to check permissions,
if the file permission is only rw i want to receive an e-mail.
rw means 600,
i did something like that but it only checks folders, not the files under the folder.

#!/bin/sh
PERM=600
PARENT=/.../folder
folders=$(find $PARENT -type d ! -perm $PERM)
if [ -n "$folders" ]
then
echo "$folders" | mailx -s "smt wrong in permission" abc@xzy.com
fi

what should i do? thank you in advance.latest?d=yIl2AUoC8zA latest?i=-USye2LnvXU:xv6n7PWICXg:F7zBnMy latest?i=-USye2LnvXU:xv6n7PWICXg:V_sGLiP latest?d=qj6IDK7rITs latest?i=-USye2LnvXU:xv6n7PWICXg:gIN9vFw-USye2LnvXU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments