Is it possible to clean tmpfiles with systemd-tmpfiles only if a certain directory exists?

Solution Verified - Updated -

Issue

  • There is a need to clean content from a directory based on age, but only if the directory exists.
  • Filetype D in a tmpfiles.d conf file doesn't work, because it will create the directory if it doesn't exist. R doesn't use the age parameter.

Environment

  • Red Hat Enterprise Linux (RHEL) 7
  • systemd-208

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content