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

Solution Unverified - 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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.