From ed7fd549d0a1bfebe4e17a3f0e92879eb986d4a9 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 8 Nov 2016 03:39:10 -0500 Subject: man: add an example how to unconditionally empty a directory (#4570) It was logical, but not entirely obvious, that 'e' with no arguments does nothing. Expand the explanation a bit and add an example. Fixes #4564. --- man/tmpfiles.d.xml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index e040a1636d..92620f0a24 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -117,8 +117,8 @@ type, path, mode, ownership, age, and argument fields: #Type Path Mode UID GID Age Argument - d /run/user 0755 root root 10d - - L /tmp/foobar - - - - /dev/null +d /run/user 0755 root root 10d - +L /tmp/foobar - - - - /dev/null Fields may be enclosed within quotes and contain C-style escapes. @@ -159,7 +159,7 @@ d Create a directory. The mode and ownership will be adjusted if specified and the directory already exists. Contents of this directory are subject - to time based cleanup if the time argument is specified. + to time based cleanup if the age argument is specified. @@ -171,9 +171,13 @@ 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. + 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. For this entry to be useful, at least one of the mode, uid, gid, or age arguments + must be specified, since otherwise this entry has no effect. If the age argument is + 0, contents of the directory will be unconditionally deleted every time + systemd-tmpfiles --clean is run. This can be useful when combined with + !, see the examples. @@ -680,6 +684,18 @@ e /var/chache/dnf/ - - - 30d /var/chache/dnf/ will be removed after they have not been accessed in 30 days. + + + Empty the contents of the a cache directory on boot + + # /usr/lib/tmpfiles.d/krb5rcache.conf +e! /var/cache/krb5rcache - - - 0 + + + Any files and subdirectories in /var/cache/krb5rcache/ + will be removed on boot. The directory will not be created. + + -- cgit v1.2.3-54-g00ecf