mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
* `--min-age' flag in nix-store and nix-collect-garbage to only delete
unreachable paths that haven't been used for N hours. For instance, `nix-collect-garbage --min-age 168' only deletes paths that haven't been accessed in the last week. This is useful for instance in the build farm where many derivations can be shared between consecutive builds, and we wouldn't want a garbage collect to throw them all away. We could of course register them as roots, but then we'd to unregister them at some point, which would be a pain to manage. The `--min-age' flag gives us a sort of MRU caching scheme. BUG: this really shouldn't be in gc.cc since that violates mechanism/policy separation.
This commit is contained in:
parent
fdec72c6cc
commit
eb233e728f
6 changed files with 70 additions and 17 deletions
|
@ -11,6 +11,7 @@
|
|||
<arg choice='plain'><option>--print-live</option></arg>
|
||||
<arg choice='plain'><option>--print-dead</option></arg>
|
||||
</group>
|
||||
<arg><option>--min-age</option> <replaceable>age</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
@ -56,6 +57,16 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<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>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</refsection>
|
||||
|
|
|
@ -147,6 +147,7 @@
|
|||
<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>
|
||||
|
||||
|
@ -207,6 +208,17 @@
|
|||
Each line should contain exactly one store path.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The option <option>--min-age</option> specifies a minimum time
|
||||
in hours that an unreachable store path must not have been
|
||||
used before it is considered dead. The default is 0 (consider
|
||||
all unreachable store paths dead). Whether a store path has
|
||||
been used is determined by looking at its access time
|
||||
(<literal>atime</literal>), so this does not work if the store
|
||||
is located on a file system that has the
|
||||
<literal>noatime</literal> option set.
|
||||
</para>
|
||||
|
||||
<warning>
|
||||
<para>
|
||||
You generally will want to use the command
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue