I am struggling with the following problem. I have read the following guide: Getting new files to inherit group permissions on Linux Yet, this has not helped me.
(pgcluu is a postgresql cluster monitoring program)
I am using Debian server
I have a folder /var/www/pgcluu
Inside that folder i have stats reports folders. I have changed stats folder permission and ownership over to postgres. chmod -R postgres:postgres /var/www/pgcluu (so the full folder is owner by postgres)
pgCluu on the other hand is collecting data and is generating files inside stats folder. Looking something like. /var/www/pgcluu/stat/2018/04/04/09 basically /year/month/day/hour/ Inside the hour folder i have files like
-rw-r-----+ 1 postgres postgres 44 Apr 4 10:20 pg_stat_connections.csv -rw-r-----+ 1 postgres postgres 940 Apr 4 10:20 pg_stat_database_conflicts.csv -rw-r-----+ 1 postgres postgres 2479 Apr 4 10:20 pg_stat_database.csv -rw-r-----+ 1 postgres postgres 1 Apr 4 10:20 pg_stat_replication.csv -rw-r-----+ 1 postgres postgres 0 Apr 4 10:20 pg_stat_statements.csv -rw-r-----+ 1 postgres postgres 88 Apr 4 10:20 postgresql.auto.conf -rw-r-----+ 1 postgres postgres 21425 Apr 4 10:20 postgresql.conf -rw-r-----+ 1 postgres postgres 70009 Apr 4 10:20 sysinfo.txt
This is just an example, there are alot of more files.
The files are generated by pgcluu_collectd every minute (u can change it) But they need to be rewritten, therefor it needs to have rw- rw- --- permissions to do it. (Owner and group must have read and write on the files) Each time i change it myself, pgcluu_collectd makes the files with rw- r-- --- permissions again.
Therefor, is there a away that the files would inherit permissions from the folder /var/www/pgcluu/stats