Chmod on directories and files with systemd.tmpfiles

Hi,

I want to have the same result as with these shell commands but by using tmpfiles rules

find ./data/ ! -perm 750 -type d -exec chmod 0750 {} \;
find ./data/ ! -perm 640 -type f -exec chmod 0640 {} \;

I use following rule to create data directory with his content ( ${sources.${dataVersion}} is a npins source)

C ${dataDir} 0750 ${app} ${app} - ${sources.${dataVersion}}

If I use the rule below, it will adjust the mode recursively on directories and files

Z ${dataDir} 0750 - - - -

Is there a way to adjust mode recursively only on files or only on directories ?

I don’t recall offhand, but see man systemd.tmpfiles to verify which options are available.

I didn’t see any options that would make distinction between files and directories.

Correction, I meant man tmpfiles.d.
There’s a section on modifiers for the mode, you can use ~ to mask the existing mode