2004-02-10 18:14:47 +02:00
|
|
|
<refentry>
|
|
|
|
<refnamediv>
|
|
|
|
<refname>nix-collect-garbage</refname>
|
2004-08-25 18:39:13 +03:00
|
|
|
<refpurpose>remove unreachable store paths</refpurpose>
|
2004-02-10 18:14:47 +02:00
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<cmdsynopsis>
|
|
|
|
<command>nix-collect-garbage</command>
|
2004-08-25 18:39:13 +03:00
|
|
|
<group choice='opt'>
|
|
|
|
<arg choice='plain'><option>--print-live</option></arg>
|
|
|
|
<arg choice='plain'><option>--print-dead</option></arg>
|
|
|
|
</group>
|
2004-08-25 19:54:08 +03:00
|
|
|
<arg><option>--min-age</option> <replaceable>age</replaceable></arg>
|
2004-02-10 18:14:47 +02:00
|
|
|
</cmdsynopsis>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsection>
|
|
|
|
<title>Description</title>
|
|
|
|
|
|
|
|
<para>
|
2004-08-25 18:39:13 +03:00
|
|
|
The command <command>nix-collect-garbage</command> performs a
|
|
|
|
garbage collection on the Nix store: any paths in the Nix store
|
|
|
|
that are garbage (not reachable from a set of root store
|
|
|
|
expressions) are deleted.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
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).
|
2004-02-10 18:14:47 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</refsection>
|
|
|
|
|
|
|
|
<refsection>
|
|
|
|
<title>Options</title>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
|
|
|
|
<varlistentry>
|
2004-08-25 18:39:13 +03:00
|
|
|
<term><option>--print-live</option> / <option>--print-dead</option></term>
|
2004-02-10 18:14:47 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-08-25 18:39:13 +03:00
|
|
|
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>.
|
2004-02-10 18:14:47 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2004-08-25 19:54:08 +03:00
|
|
|
<varlistentry>
|
|
|
|
<term><option>--min-age</option> <replaceable>age</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
This option corresponds to the <option>--min-age</option>
|
|
|
|
option in <command>nix-store <option>--gc</option></command>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2004-02-10 18:14:47 +02:00
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
</refsection>
|
|
|
|
|
|
|
|
<refsection>
|
|
|
|
<title>Examples</title>
|
|
|
|
|
|
|
|
<para>
|
2004-08-25 18:39:13 +03:00
|
|
|
To delete all unreachable paths, just do:
|
2004-02-10 18:14:47 +02:00
|
|
|
|
|
|
|
<screen>
|
2004-08-25 18:39:13 +03:00
|
|
|
$ nix-collect-garbage</screen>
|
2004-02-10 18:14:47 +02:00
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</refsection>
|
|
|
|
|
|
|
|
</refentry>
|