Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Schedule permissions propegations

Hi guys, hoping someone can help me here.


We have a Mac Server running OS X 10.6.8. We use it as a file server and have it set up using an 8TB RAID volume. Within this volume we have an archive folder that only certain people within the organization have write access to, everyone else has read only. This is set up using ACL. From time to time someone who has write access will move a file/folder to the archive and it will copy it previous permissions with it (full access for everyone). This is easily sorted by propagating permissions using Server Admin.


What I want to do is set up an automatic task that does this daily. I have been researching:


1. a terminal command that will do this and

2. how to run it as a scheduled task.


If anyone could point me in the right direction I would be very grateful!


Thanks


Adam

OS X Server

Posted on Mar 4, 2014 7:28 AM

Reply
1 reply

Mar 4, 2014 8:40 AM in response to djmonsta

Some search hints, per request...


You could use launchd to schedule the task — with the launchd entry generated via the Lingon tool, or by editing and entering the plist data manually — there are examples of launchd and launchctl commands around — and then a shell script (running as root) that does something akin to the following shell script:

#!/bin/bash

chmod -R u=rwx,g=rwx,o= /path/to/files

chown -R user:group /path/to/files


The launchd stuff is a cryptically-formatted wad of data for which Apple still provides no tool to generate, but it's pretty easy to generate the stuff manually after some research into the format, or use the Lingon or similar tool to generate the plist for you.


You could also have a script (bash or AppleScript) trigger when the directory is modified, as an alternative approach.


You could also use the periodic stuff — at the command line, issue man periodic with a very general overview of periodic here — to invoke the script nightly without needing the plist.


Somebody has probably already written this tool, too.


Alternatively, you could provide the users with a tool which migrates the files, and sets things up appropriately to start with. That might be a droplet, some Python or such, or an AppleScript. Related discussions here and here. (The droplet means the users drag the file onto the script icon, and the script then moves the file to the archive file and prepares and protects it appropriately.)


Hopefully you now have a few more search targets for your research...

Schedule permissions propegations

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.