diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-11-08 03:39:10 -0500 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-11-08 09:39:10 +0100 |
commit | ed7fd549d0a1bfebe4e17a3f0e92879eb986d4a9 (patch) | |
tree | 95c66d0304416cfcac9f3599664234254c9384d1 | |
parent | d07903848f7b3b96487e0968f25d88167cc65ded (diff) |
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.
-rw-r--r-- | man/tmpfiles.d.xml | 28 |
1 files 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:</para> <programlisting>#Type Path Mode UID GID Age Argument - d /run/user 0755 root root 10d - - L /tmp/foobar - - - - /dev/null</programlisting> +d /run/user 0755 root root 10d - +L /tmp/foobar - - - - /dev/null</programlisting> <para>Fields may be enclosed within quotes and contain C-style escapes.</para> @@ -159,7 +159,7 @@ <term><varname>d</varname></term> <listitem><para>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.</para></listitem> + to time based cleanup if the age argument is specified.</para></listitem> </varlistentry> <varlistentry> @@ -171,9 +171,13 @@ <varlistentry> <term><varname>e</varname></term> - <listitem><para>Similar to <varname>d</varname>, 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.</para></listitem> + <listitem><para>Similar to <varname>d</varname>, 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 + <literal>0</literal>, contents of the directory will be unconditionally deleted every time + <command>systemd-tmpfiles --clean</command> is run. This can be useful when combined with + <varname>!</varname>, see the examples.</para></listitem> </varlistentry> <varlistentry> @@ -680,6 +684,18 @@ e /var/chache/dnf/ - - - 30d <filename>/var/chache/dnf/</filename> will be removed after they have not been accessed in 30 days.</para> </example> + + <example> + <title>Empty the contents of the a cache directory on boot</title> + + <programlisting># /usr/lib/tmpfiles.d/krb5rcache.conf +e! /var/cache/krb5rcache - - - 0 +</programlisting> + + <para>Any files and subdirectories in <filename>/var/cache/krb5rcache/</filename> + will be removed on boot. The directory will not be created. + </para> + </example> </refsect1> <refsect1> |