Próximo: , Anterior: , Acima: Serviços   [Conteúdo][Índice]


11.10.11 File Search Services

The services in this section populate file databases that let you search for files on your machine. These services are provided by the (gnu services admin) module.

The first one, file-database-service-type, periodically runs the venerable updatedb command (veja Invoking updatedb em GNU Findutils). That command populates a database of file names that you can then search with the locate command (veja Invoing locate em GNU Findutils), as in this example:

locate important-notes.txt

You can enable this service with its default settings by adding this snippet to your operating system services:

(service file-database-service-type)

This updates the database once a week, excluding files from /gnu/store—these are more usefully handled by guix locate (veja Invocando guix locate). You can of course provide a custom configuration, as described below.

Variável: file-database-service-type

This is the type of the file database service, which runs updatedb periodically. Its associated value must be a file-database-configuration record, as described below.

Data Type: file-database-configuration

Record type for the file-database-service-type configuration, with the following fields:

package (default: findutils)

The GNU Findutils package from which the updatedb command is taken.

schedule (default: %default-file-database-update-schedule)

String or G-exp denoting an mcron schedule for the periodic updatedb job (veja Guile Syntax em GNU mcron).

excluded-directories (default %default-file-database-excluded-directories)

List of regular expressions of directories to ignore when building the file database. By default, this includes /tmp and /gnu/store; the latter should instead be indexed by guix locate (veja Invocando guix locate). This list is passed to the --prunepaths option of updatedb (veja Invoking updatedb em GNU Findutils).

The second service, package-database-service-type, builds the database used by guix locate, which lets you search for packages that contain a given file (veja Invocando guix locate). The service periodically updates a system-wide database, which will be readily available to anyone running guix locate on the system. To use this service with its default settings, add this snippet to your service list:

(service package-database-service-type)

This will run guix locate --update once a week.

Variável: package-database-service-type

This is the service type for periodic guix locate updates (veja Invocando guix locate). Its value must be a package-database-configuration record, as shown below.

Data Type: package-database-configuration

Data type to configure periodic package database updates. It has the following fields:

package (default: guix)

The Guix package to use.

schedule (default: %default-package-database-update-schedule)

String or G-exp denoting an mcron schedule for the periodic guix locate --update job (veja Guile Syntax em GNU mcron).

method (default: 'store)

Indexing method for guix locate. The default value, 'store, yields a more complete database but is relatively expensive in terms of CPU and input/output.

channels (default: #~%default-channels)

G-exp denoting the channels to use when updating the database (veja Canais).


Próximo: Serviços de bancos de dados, Anterior: Serviços de som, Acima: Serviços   [Conteúdo][Índice]