• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 42
  • Last Modified:

Need to ensure directory permissions stay set to 755

Need to ensure directory permissions stay set to 755. We have a program that stores files in /var/log/rederUI. I need the permissions to stay set on this directory to 755 so that internal service accounts can access world readable files in it. Vendor patches will change the permissions to be more restrictive so each time the server is updated, I have to reset permissions. I'd like to create a cron job to reset them to 755 anytime the restart is done. Though I know how to do this manually, what would be the best way to set it up in cron? Create a simple bash script to set the permissions and have cron run it? Is there a way to have cron only run a script or command at startup?
1 Solution
Gerwin Jansen, EE MVETopic Advisor Commented:
put the chmod command in your crontab with @reboot in front of it:

@reboot /bin/chmod 755 <your folder>

check that chmod is in /bin and replace <your folder> with the path of your target folder
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now