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.


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.