Suivant: Services de bases de données, Précédent: Services de son, Monter: Services [Table des matières][Index]
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 (voir Invoking updatedb dans GNU
Findutils). That command populates a database of file names that you can
then search with the locate
command (voir Invoing locate dans 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:
This updates the database once a week, excluding files from
/gnu/store—these are more usefully handled by guix locate
(voir Invoking guix locate
). You can of course provide a custom
configuration, as described below.
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.
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 (voir Guile Syntax dans 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
(voir Invoking guix locate
). This list is passed to the --prunepaths option of
updatedb
(voir Invoking updatedb dans 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 (voir Invoking 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:
This will run guix locate --update
once a week.
This is the service type for periodic guix locate
updates
(voir Invoking guix locate
). Its value must be a
package-database-configuration
record, as shown below.
Data type to configure periodic package database updates. It has the following fields:
package
(default: guix
)Le paquet Guix à utiliser.
schedule
(default: %default-package-database-update-schedule
)String or G-exp denoting an mcron schedule for the periodic guix
locate --update
job (voir Guile Syntax dans 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
(par défaut : #~%default-channels
)G-exp denoting the channels to use when updating the database (voir Canaux).
Suivant: Services de bases de données, Précédent: Services de son, Monter: Services [Table des matières][Index]