I'm sure it's not the most elegant way to do it but it seems to work well enough.
I was looking all over for something that could be stuck in a cron job to modify the permissions on any directory in a tree with the words "Do Not Modify" in the name. The idea is that it should make all of the files in those directories read only but preserve the permissions of the Directory itself and anything not in that "Do Not Modify" directory.
Here's what I came up with. Have at thee.

I was looking all over for something that could be stuck in a cron job to modify the permissions on any directory in a tree with the words "Do Not Modify" in the name. The idea is that it should make all of the files in those directories read only but preserve the permissions of the Directory itself and anything not in that "Do Not Modify" directory.

It assumes that any files in directories with DNM in their names and their subdirectories are to become read-only. Files in other directories (even files with DNM in their names) will be untouched. As a bonus, this command works also if there are spaces in file names.

This is a small test. I marked with â˜… the files affected by the command:

Who is online

Users browsing this forum: Google [Bot] and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum