* GC docs.
This commit is contained in:
parent
128c174295
commit
806b91f104
|
@ -1,77 +1,29 @@
|
||||||
<refentry>
|
<refentry>
|
||||||
<refnamediv>
|
|
||||||
<refname>nix-collect-garbage</refname>
|
<refnamediv>
|
||||||
<refpurpose>remove unreachable store paths</refpurpose>
|
<refname>nix-collect-garbage</refname>
|
||||||
</refnamediv>
|
<refpurpose>delete unreachable store paths</refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>nix-collect-garbage</command>
|
<command>nix-collect-garbage</command>
|
||||||
<group choice='opt'>
|
<group choice='opt'>
|
||||||
<arg choice='plain'><option>--print-live</option></arg>
|
<arg choice='plain'><option>--print-roots</option></arg>
|
||||||
<arg choice='plain'><option>--print-dead</option></arg>
|
<arg choice='plain'><option>--print-live</option></arg>
|
||||||
</group>
|
<arg choice='plain'><option>--print-dead</option></arg>
|
||||||
<arg><option>--min-age</option> <replaceable>age</replaceable></arg>
|
<arg choice='plain'><option>--delete</option></arg>
|
||||||
</cmdsynopsis>
|
</group>
|
||||||
</refsynopsisdiv>
|
</cmdsynopsis>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsection>
|
<refsection><title>Description</title>
|
||||||
<title>Description</title>
|
|
||||||
|
|
||||||
<para>
|
<para>The command <command>nix-collect-garbage</command> is an
|
||||||
The command <command>nix-collect-garbage</command> performs a
|
obsolete wrapper around <link
|
||||||
garbage collection on the Nix store: any paths in the Nix store
|
linkend="rsec-nix-store-gc"><command>nix-store
|
||||||
that are garbage (not reachable from a set of root store
|
--gc</command></link>.</para>
|
||||||
expressions) are deleted.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
</refsection>
|
||||||
The roots of the garbage collector are the store expressions
|
|
||||||
mentioned in the files in the directory
|
|
||||||
<filename><replaceable>prefix</replaceable>/var/nix/gcroots</filename>.
|
|
||||||
By default, the roots are all user environments in
|
|
||||||
<filename><replaceable>prefix</replaceable>/var/nix/profiles</filename>.
|
|
||||||
You can register other store expressions as roots by writing the
|
|
||||||
full path of the store expression to an arbitrary file in the
|
|
||||||
<filename>gcroots</filename> directory (or a subdirectory
|
|
||||||
thereof).
|
|
||||||
</para>
|
|
||||||
|
|
||||||
</refsection>
|
|
||||||
|
|
||||||
<refsection>
|
|
||||||
<title>Options</title>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>--print-live</option> / <option>--print-dead</option></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
These options cause the set of live or dead paths to be
|
|
||||||
printed, respectively, rather than performing an actual
|
|
||||||
garbage collector. They correspond exactly with the
|
|
||||||
sub-operations in <command>nix-store
|
|
||||||
<option>--gc</option></command>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
</refsection>
|
|
||||||
|
|
||||||
<refsection>
|
|
||||||
<title>Examples</title>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
To delete all unreachable paths, just do:
|
|
||||||
|
|
||||||
<screen>
|
|
||||||
$ nix-collect-garbage</screen>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
</refsection>
|
|
||||||
|
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
|
@ -146,126 +146,121 @@ output.</para>
|
||||||
|
|
||||||
<!--######################################################################-->
|
<!--######################################################################-->
|
||||||
|
|
||||||
<refsection>
|
<refsection id='rsec-nix-store-gc'><title>Operation <option>--gc</option></title>
|
||||||
<title>Operation <option>--gc</option></title>
|
|
||||||
|
|
||||||
<refsection>
|
<refsection><title>Synopsis</title>
|
||||||
<title>Synopsis</title>
|
|
||||||
<cmdsynopsis>
|
|
||||||
<command>nix-store</command>
|
|
||||||
<arg choice='plain'><option>--gc</option></arg>
|
|
||||||
<group choice='req'>
|
|
||||||
<arg choice='plain'><option>--print-live</option></arg>
|
|
||||||
<arg choice='plain'><option>--print-dead</option></arg>
|
|
||||||
<arg choice='plain'><option>--delete</option></arg>
|
|
||||||
</group>
|
|
||||||
<arg><option>--min-age</option> <replaceable>age</replaceable></arg>
|
|
||||||
</cmdsynopsis>
|
|
||||||
</refsection>
|
|
||||||
|
|
||||||
<refsection>
|
<cmdsynopsis>
|
||||||
<title>Description</title>
|
<command>nix-store</command>
|
||||||
|
<arg choice='plain'><option>--gc</option></arg>
|
||||||
|
<group choice='req'>
|
||||||
|
<arg choice='plain'><option>--print-roots</option></arg>
|
||||||
|
<arg choice='plain'><option>--print-live</option></arg>
|
||||||
|
<arg choice='plain'><option>--print-dead</option></arg>
|
||||||
|
<arg choice='plain'><option>--delete</option></arg>
|
||||||
|
</group>
|
||||||
|
</cmdsynopsis>
|
||||||
|
|
||||||
|
</refsection>
|
||||||
|
|
||||||
|
<refsection><title>Description</title>
|
||||||
|
|
||||||
<para>
|
<para>Without additional flags, the operation <option>--gc</option>
|
||||||
Without additional flags, the operation <option>--gc</option>
|
performs a garbage collection on the Nix store. That is, all paths in
|
||||||
performs a garbage collection on the Nix store. That is, all
|
the Nix store not reachable via file system references from a set of
|
||||||
paths in the Nix store not reachable via file system
|
<quote>roots</quote>, are deleted.</para>
|
||||||
references from a set of <quote>roots</quote>, are deleted.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
<para>The following suboperations may be specified:</para>
|
||||||
The following flags may be specified:
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry><term><option>--print-roots</option></term>
|
||||||
<term><option>--print-roots</option></term>
|
|
||||||
<listitem>
|
<listitem><para>This operation prints on standard output the set
|
||||||
<para>
|
of roots used by the garbage collector.</para></listitem>
|
||||||
This operation prints on standard output the set of
|
|
||||||
roots used by the garbage collector.
|
</varlistentry>
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry><term><option>--print-live</option></term>
|
||||||
<term><option>--print-live</option></term>
|
|
||||||
<listitem>
|
<listitem><para>This operation prints on standard output the set
|
||||||
<para>
|
of <quote>live</quote> store paths, which are all the store paths
|
||||||
This operation prints on standard output the set of
|
reachable from the roots. Live paths should never be deleted,
|
||||||
<quote>live</quote> store paths, which are all the store
|
since that would break consistency — it would become possible that
|
||||||
paths reachable from the roots. Live paths should never
|
applications are installed that reference things that are no
|
||||||
be deleted, since that would break consistency — it
|
longer present in the store.</para></listitem>
|
||||||
would become possible that applications are installed
|
|
||||||
that reference things that are no longer present in the
|
</varlistentry>
|
||||||
store.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry><term><option>--print-dead</option></term>
|
||||||
<term><option>--print-dead</option></term>
|
|
||||||
<listitem>
|
<listitem><para>This operation prints out on standard output the
|
||||||
<para>
|
set of <quote>dead</quote> store paths, which is just the opposite
|
||||||
This operation prints out on standard output the set of
|
of the set of live paths: any path in the store that is not live
|
||||||
<quote>dead</quote> store paths, which is just the
|
(with respect to the roots) is dead.</para></listitem>
|
||||||
opposite of the set of live paths: any path in the store
|
|
||||||
that is not live (with respect to the roots) is dead.
|
</varlistentry>
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry><term><option>--delete</option></term>
|
||||||
<term><option>--delete</option></term>
|
|
||||||
<listitem>
|
<listitem><para>This operation performs an actual garbage
|
||||||
<para>
|
collection. All dead paths are removed from the
|
||||||
This operation performs an actual garbage collection.
|
store. This is the default.</para></listitem>
|
||||||
All dead paths are removed from the store.
|
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
||||||
</refsection>
|
</refsection>
|
||||||
|
|
||||||
<refsection>
|
|
||||||
<title>Roots</title>
|
|
||||||
|
|
||||||
<para>The roots of the garbage collector are all store paths to
|
|
||||||
which there are symlinks in the
|
<refsection><title>Roots</title>
|
||||||
directory <filename><replaceable>prefix</replaceable>/nix/var/nix/gcroots</filename>.
|
|
||||||
For instance, the following command makes the
|
<para>The roots of the garbage collector are all store paths to which
|
||||||
path <filename>/nix/store/d718ef...-foo</filename> a root of
|
there are symlinks in the directory
|
||||||
the collector:
|
<filename><replaceable>prefix</replaceable>/nix/var/nix/gcroots</filename>.
|
||||||
|
For instance, the following command makes the path
|
||||||
|
<filename>/nix/store/d718ef...-foo</filename> a root of the collector:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
$ ln -s /nix/store/d718ef...-foo /nix/var/nix/gcroots/bar</screen>
|
$ ln -s /nix/store/d718ef...-foo /nix/var/nix/gcroots/bar</screen>
|
||||||
|
|
||||||
That is, after this command, the garbage collector will not
|
That is, after this command, the garbage collector will not remove
|
||||||
remove <filename>/nix/store/d718ef...-foo</filename> or any of
|
<filename>/nix/store/d718ef...-foo</filename> or any of its
|
||||||
its dependencies.</para>
|
dependencies.</para>
|
||||||
|
|
||||||
<para>Subdirectories
|
<para>Subdirectories of
|
||||||
of <filename><replaceable>prefix</replaceable>/nix/var/nix/gcroots</filename>
|
<filename><replaceable>prefix</replaceable>/nix/var/nix/gcroots</filename>
|
||||||
are also searched for symlinks. Symlinks to non-store paths are
|
are also searched for symlinks. Symlinks to non-store paths are
|
||||||
followed and searched for roots, but TODO.</para>
|
followed and searched for roots, but TODO.</para>
|
||||||
|
|
||||||
</refsection>
|
</refsection>
|
||||||
|
|
||||||
<refsection>
|
|
||||||
<title>Configuration file</title>
|
|
||||||
|
|
||||||
<para>TODO</para>
|
<refsection><title>Configuration file</title>
|
||||||
|
|
||||||
</refsection>
|
<para>TODO</para>
|
||||||
|
|
||||||
</refsection>
|
</refsection>
|
||||||
|
|
||||||
|
|
||||||
|
<refsection><title>Examples</title>
|
||||||
|
|
||||||
|
<para>To delete all unreachable paths, just do:
|
||||||
|
|
||||||
|
<screen>
|
||||||
|
$ nix-store --gc</screen>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
</refsection>
|
||||||
|
|
||||||
|
|
||||||
|
</refsection>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--######################################################################-->
|
<!--######################################################################-->
|
||||||
|
|
||||||
<refsection>
|
<refsection>
|
||||||
<title>Operation <option>--query</option></title>
|
<title>Operation <option>--query</option></title>
|
||||||
|
@ -586,10 +581,3 @@ x=`nix-store --query --normalise --force-realise /nix/store/bla.store`
|
||||||
|
|
||||||
|
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
local variables:
|
|
||||||
sgml-parent-document: ("book.xml" "refentry")
|
|
||||||
end:
|
|
||||||
-->
|
|
||||||
|
|
|
@ -230,8 +230,3 @@ table.productionset table.productionset
|
||||||
{
|
{
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
a[href] {
|
|
||||||
text-decoration: none;
|
|
||||||
border-bottom: 1px dotted #005aa0;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue