mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
nix-collect-garbage: Add --delete-older-than option
This commit is contained in:
parent
7ef7597f71
commit
034b6f6062
2 changed files with 22 additions and 8 deletions
|
@ -20,6 +20,7 @@
|
|||
<command>nix-collect-garbage</command>
|
||||
<arg><option>--delete-old</option></arg>
|
||||
<arg><option>-d</option></arg>
|
||||
<arg><option>--delete-older-than</option> <replaceable>period</replaceable></arg>
|
||||
<group choice='opt'>
|
||||
<arg choice='plain'><option>--print-roots</option></arg>
|
||||
<arg choice='plain'><option>--print-live</option></arg>
|
||||
|
@ -35,13 +36,18 @@
|
|||
<para>The command <command>nix-collect-garbage</command> is mostly an
|
||||
alias of <link linkend="rsec-nix-store-gc"><command>nix-store
|
||||
--gc</command></link>, that is, it deletes all unreachable paths in
|
||||
the Nix store to clean up your system. However, it provides an
|
||||
additional option <option>-d</option> (<option>--delete-old</option>)
|
||||
that deletes all old generations of all profiles in
|
||||
the Nix store to clean up your system. However, it provides two
|
||||
additional options: <option>-d</option> (<option>--delete-old</option>),
|
||||
which deletes all old generations of all profiles in
|
||||
<filename>/nix/var/nix/profiles</filename> by invoking
|
||||
<literal>nix-env --delete-generations old</literal> on all profiles.
|
||||
Of course, this makes rollbacks to previous configurations
|
||||
impossible.</para>
|
||||
<literal>nix-env --delete-generations old</literal> on all profiles
|
||||
(of course, this makes rollbacks to previous configurations
|
||||
impossible); and
|
||||
<option>--delete-older-than</option> <replaceable>period</replaceable>,
|
||||
where period is a value such as <literal>30d</literal>, which deletes
|
||||
all non-current generations that are older than the specified number of
|
||||
days in all profiles in <filename>/nix/var/nix/profiles</filename>.
|
||||
</para>
|
||||
|
||||
</refsection>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue