From 63ccd724968569455bb7d54f0badcfec18d18e9d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 19 Nov 2008 17:00:32 +0000 Subject: * Updated the manual. --- doc/manual/nix-store.xml | 135 ++++++++++++++++++++++++++++++++++++++++++- doc/manual/release-notes.xml | 2 +- 2 files changed, 134 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/manual/nix-store.xml b/doc/manual/nix-store.xml index da3eae2ec402..db5f8c344622 100644 --- a/doc/manual/nix-store.xml +++ b/doc/manual/nix-store.xml @@ -128,6 +128,7 @@ lrwxrwxrwx 1 ... 2005-03-13 21:10 /home/eelco/bla/result -> /nix/store/1r1134 paths + @@ -166,6 +167,11 @@ the specified store paths. Realisation is a somewhat overloaded term: output. (For non-derivations argument, the argument itself is printed.) +If the option is used, then +nix-store will print on standard error a +description of what packages would be built or downloaded, and then +quit. + @@ -204,6 +210,10 @@ linkend="sec-nix-build">nix-build does. + bytes + nrlinks + atime + @@ -258,7 +268,70 @@ the Nix store not reachable via file system references from a set of -The behaviour of the collector is influenced by the By default, all unreachable paths are deleted. The following +options control what gets deleted and in what order: + + + + bytes + + Keep deleting paths until at least + bytes bytes have been + deleted, then stop. + + + + nrlinks + + Keep deleting paths until the hard link count on + /nix/store is less than + nrlinks, then stop. This is useful for + very large Nix stores on filesystems with a 32000 subdirectories + limit (like ext3). + + + + atime + + Only delete a store path if its last-accessed time + is less than atime. This allows you to + garbage-collect only packages that haven’t been used recently. + The time is expressed as the number of seconds in the Unix epoch, + i.e., since 1970-01-01 00:00:00 UTC. An easy way to convert to + this format is date +%s -d "date + specification". + + For directories, the last-accessed time is the highest + last-accessed time of any regular file in the directory (or in any + of its subdirectories). That is, the atime + field maintained by the filesystem is ignored for directories. + This is because operations such as rebuilding the + locate database tend to update the + atime values of all directories, so they’re not + a useful indicator of whether a package was recently used. + + Note that nix-store --optimise reads all + regular files in the Nix store, and so causes all last-accessed + times to be set to the present time. This makes + ineffective (for a while at + least). + + + + + + Delete store paths in order of ascending + last-accessed time. This is useful in conjunction with the other + options to delete only the least recently used + packages. + + + + + + + +The behaviour of the collector is also influenced by the gc-keep-outputs and gc-keep-derivations @@ -284,6 +357,20 @@ deleting `/nix/store/kq82idx6g0nyzsp2s14gfsc38npai7lf-cairo-1.0.4.tar.gz.drv' +To delete unreachable paths not accessed in the last two months: + + +$ nix-store --gc -v --max-atime $(date +%s -d "2 months ago") + + + +To delete at least 100 MiBs of unreachable paths: + + +$ nix-store --gc --max-freed $((100 * 1024 * 1024)) + + + @@ -950,7 +1037,51 @@ ktorrent-2.2.1/NEWS - + + +Operation <option>--dump-db</option> + + + Synopsis + + nix-store + + + + +Description + +The operation writes a dump of the +Nix database to standard output. It can be loaded into an empty Nix +store using . This is useful for making +backups and when migrating to different database schemas. + + + + + + + + +Operation <option>--dump-db</option> + + + Synopsis + + nix-store + + + + +Description + +The operation reads a dump of the Nix +database created by from standard input and +loads it into the Nix database. + + + + diff --git a/doc/manual/release-notes.xml b/doc/manual/release-notes.xml index eec4ab6ba9b3..9d7bb4493c75 100644 --- a/doc/manual/release-notes.xml +++ b/doc/manual/release-notes.xml @@ -68,7 +68,7 @@ $ rm __db* log.* derivers references referrers reserved validpaths DB_CONFIG--max-links N tells it to stop after the link count on /nix/store has dropped below - N. This is useful on very large Nix + N. This is useful for very large Nix stores on filesystems with a 32000 subdirectories limit (like ext3). The option causes store paths to be deleted in order of ascending last access -- cgit 1.4.1