recursion - monitor tree with systemd path unit and pass parameter to service -
with systemd path units, possible monitor, not single directory or file, recursively monitor sub directories within directory without explicitly listing each one? tried wild cards didn't work though docs make mention of wildcard expansion. i'm finding .path units of extremely limited value.
mysolution.path
[unit] description="file monitor path unit" [path] directorynotempty=/var/opt/mysolution #directorynotempty=/var/opt/mysolution/* #pathchanged=/var/opt/mysolution/*/* #pathchanged=/var/opt/mysolution/subdir [install] wantedby=multi-user.target
the commented out lines ones did not work @ all
mysolution.service
[unit] description="file monitor service unit" [service] type=oneshot execstart=/bin/chmod -fr ug+rw /var/opt/mysolution/subdir #execstart=/bin/chmod -fr ug+rw /var/opt/mysolution/* # don't want change permissions on mysolution, files , dirs under directory [install] wantedby=multi-user.target
is possible this? don't want have manually maintain each individual directory , file has monitored. need notified of new files in sub-directory of /var/opt/mysolution/* directories. can systemd without having turn kind of hack?
also, once new file show up, nice pass corresponding service. there way that?
Comments
Post a Comment