Hints for writing a service - ownership

I do have a process writing as root (0644) log files and other the FreeBSD System.
Those files I want to fetch and delete them by using sFTP as a regular user.

As I am pretty unfamiliar with FreeBSD I would welcome some hints to "automatically" change in the background by a script (or otherwise) the permission of all files in a specified directory.
So far, I think I will have to write a service / script linked with rc.conf. I do not know what is the best practise within this service/script. My actual thought goes in the directon to oeriodially set the permissions to all files within the directory.
This isn't really elegant so I hope somebody has a better idea
 
Your question is unclear to me.
Here an example script,
Instead of printing hello world you could chown,chmod at regular intervals ?
 
make the parent dir of said files g=rwx for the sftp user's primary group
then you can delete them with sftp, rsync, whatever
you can also play with acls (setfacl)
 
Back
Top