Flush a Policy Log

strider_knh
Contributor II

I have an principal at a school that would like to periodically copy a few files to every teacher's laptop. I would like to have a self service item for him to initiate when he wants. The self service item would copy the files to a server and then flush the logs of a policy that would copy the files to every teacher's laptop when it checked in.

Setting up the self service item to copy the files to the server is easy enough, script will make that easy, as is creating the policy to copy the files to every teacher's laptop, another script. What I don't know is how have the self service item flush the policy's logs. The principal does not have access to the JSS database to flush the logs, trying to make this as easy as possible for him.

If anyone has any idea as to how to complete this I would be appreciative. If you have an idea on another way to complete this that would also be helpful.

1 ACCEPTED SOLUTION

localhorst
Contributor

Have you considered using an ongoing, daily policy that simply rsyncs the folder on the server to the client in case one is able to mount the server?

  • Execution Frequency: once every day
  • Trigger: Recurring Check-in
  • Self Service: enabled
  • Scoped only to your teachers

Script would be something like:

# mount network server here 

if [ -d <MOUNT POINT OF SERVER ];
  rsync -a <SOURCE ON SERVER> <DESTIONATION>
fi

In case you happen to run the only true OS and you have sftp/scp access to the server, you could simply do a rsync over SSH using a passphrase less key that grants only read only access to that folder.

View solution in original post

2 REPLIES 2

localhorst
Contributor

Have you considered using an ongoing, daily policy that simply rsyncs the folder on the server to the client in case one is able to mount the server?

  • Execution Frequency: once every day
  • Trigger: Recurring Check-in
  • Self Service: enabled
  • Scoped only to your teachers

Script would be something like:

# mount network server here 

if [ -d <MOUNT POINT OF SERVER ];
  rsync -a <SOURCE ON SERVER> <DESTIONATION>
fi

In case you happen to run the only true OS and you have sftp/scp access to the server, you could simply do a rsync over SSH using a passphrase less key that grants only read only access to that folder.

strider_knh
Contributor II

That is a good idea, I hadn't though of using a sync command. With this I will be able to make sure the teachers have to most updated version.

Thank you for the help.