From df8dee85da5fa41e95dd7f536e67fcc6940a6488 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Wed, 20 Apr 2016 00:06:25 -0400 Subject: tmpfiles: add new 'e' action which cleans up a dir without creating it I wanted to add a config line that would empty a directory without creating it if doesn't exist. Existing actions don't allow this. v2: properly add 'e' to needs_glob() and takes_ownership() --- man/tmpfiles.d.xml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'man') diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index cd6d7f626c..957475d2bd 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -168,6 +168,12 @@ of the directory will be removed when is used. + + + e + Similar to d, but the directory will not be + created if it does not exist. Lines of this type accept shell-style globs in + place of normal path names. @@ -581,7 +587,7 @@ unconditionally. The age field only applies to lines starting with - d, D, + d, D, e, v, q, Q, C, x and X. If omitted or set to @@ -657,8 +663,22 @@ d /var/tmp 1777 root root 30d # /usr/lib/tmpfiles.d/abrt.conf d /var/tmp/abrt 0755 abrt abrt - + + + + + Apply clean up during boot and based on time + + # /usr/lib/tmpfiles.d/dnf.conf +r! /var/cache/dnf/*/*/download_lock.pid +r! /var/cache/dnf/*/*/metadata_lock.pid +r! /var/lib/dnf/rpmdb_lock.pid +e /var/chache/dnf/ - - - 30d + The lock files will be removed during boot. Any files and directories in + /var/chache/dnf/ will be removed after they have not been + accessed in 30 days. -- cgit v1.2.3-54-g00ecf