# newsyslog keep owner:group



## nORKy (Jul 12, 2011)

Hi,

I have this line in newsyslog.conf :

```
/var/log/httpd-clients/*/*-error-php.log                        600  3     *    @T00  BJG
```

each file has different owner:group

But, all rotation change the owner:group of the file to root:wheel
I can't set "owner:group" in newsyslog.conf because every files will have the same owner:group.
I can't write each files in newsyslog.conf, because there are too many

So, How can I keep the owner:group of files after rotation ?

thanks you


----------



## SirDice (Jul 12, 2011)

Use apache's rotatelogs(8).

http://httpd.apache.org/docs/2.0/programs/rotatelogs.html


----------



## nORKy (Jul 12, 2011)

Logs are written by php process (php-fpm), not apache.
Apache has no problem with newsyslog


----------



## AndyUKG (Jul 13, 2011)

nORKy said:
			
		

> So, How can I keep the owner:group of files after rotation ?



A custom script? As you already realised, you can only define user and group once for a given newsyslog entry so you don't have any options with that... A custom script should be fairly straight forward though...

Andy.


----------

