параметры командной строки updatedb, измененные во время обновления от 19,04 до 19,10

updatedb утилита, измененная после обновления от Ubuntu 19.04 до 19,10 (uhh, почему?). Это повредило некоторые сценарии, которые я имел, который использовал старые параметры командной строки. Новая страница справочника от новой системы не является достаточно объяснительной для идентификации, каковы новые опции должны быть.

Для ссылки старая командная строка - это (взятый из https://www.commandlinux.com/man-page/man8/updatedb.8.html, который я предполагаю, старая версия, потому что я не могу теперь найти страницу справочника для старой версии от утилиты человека на 19,10):

NAME

updatedb - update a database for mlocate
SYNOPSIS

updatedb [OPTION]...
DESCRIPTION

updatedb creates or updates a database used by locate(1). If the database already exists, its data is reused to avoid rereading directories that have not changed.

updatedb is usually run daily by cron(8) to update the default database.
EXIT STATUS

updatedb returns with exit status 0 on success, 1 on error.
OPTIONS

The PRUNE_BIND_MOUNTS, PRUNEFS, PRUNENAMES and PRUNEPATHS variables, which are modified by some of the options, are documented in detail in updatedb.conf(5).

-f, --add-prunefs FS
    Add entries in white-space-separated list FS to PRUNEFS. 
-n, --add-prunenames NAMES
    Add entries in white-space-separated list NAMES to PRUNENAMES. 
-e, --add-prunepaths PATHS
    Add entries in white-space-separated list PATHS to PRUNEPATHS. 
-U, --database-root PATH
    Store only results of scanning the file system subtree rooted at PATH to the generated database. The whole file system is scanned by default.

    locate(1) outputs entries as absolute path names which don't contain symbolic links, regardless of the form of PATH. 
--debug-pruning
    Write debugging information about pruning decisions to standard error output. 
-h, --help
    Write a summary of the available options to standard output and exit successfully. 
-o, --output FILE
    Write the database to FILE instead of using the default database. 
--prune-bind-mounts FLAG
    Set PRUNE_BIND_MOUNTS to FLAG, overriding the configuration file. 
--prunefs FS
    Set PRUNEFS to FS, overriding the configuration file. 
--prunenames NAMES
    Set PRUNENAMES to NAMES, overriding the configuration file. 
--prunepaths PATHS
    Set PRUNEPATHS to PATHS, overriding the configuration file. 
-l, --require-visibility FLAG
    Set the ``require file visibility before reporting it'' flag in the generated database to FLAG.

    If FLAG is 0 or no, or if the database file is readable by "others" or it is not owned by mlocate, locate(1) outputs the database entries even if the user running locate(1) could not have read the directory necessary to find out the file described by the database entry.

    If FLAG is 1 or yes (the default), locate(1) checks the permissions of parent directories of each entry before reporting it to the invoking user. To make the file existence truly hidden from other users, the database group is set to mlocate and the database permissions prohibit reading the database by users using other means than locate(1), which is set-gid mlocate.

    Note that the visibility flag is checked only if the database is owned by mlocate and it is not readable by "others". 
-v, --verbose
    Output path names of files to standard output, as soon as they are found. 
-V, --version
    Write information about the version and license of locate on standard output and exit successfully. 

EXAMPLES

To create a private mlocate database as an user other than root, run

    updatedb -l 0 -o db_file -U source_directory 

Note that all users that can read db_file can get the complete list of files in the subtree of source_directory.
FILES

/etc/updatedb.conf
    A configuration file. See updatedb.conf(5). 
/var/lib/mlocate/mlocate.db
    The database updated by default. 

SECURITY

Databases built with --require-visibility no allow users to find names of files and directories of other users, which they would not otherwise be able to do.
NOTES

The accompanying locate(1) utility was designed to be compatible to slocate and attempts to be compatible to GNU locate where possible. This is not the case for updatedb.
AUTHOR

Miloslav Trmac 
SEE ALSO

locate(1), mlocate.db(5), updatedb.conf(5) 

Новая updatedb страница справочника от чтений Ubuntu 19.10:

UPDATEDB(1)                                                                               General Commands Manual                                                                              UPDATEDB(1)

NAME
       updatedb - update a file name database

SYNOPSIS
       updatedb [options]

DESCRIPTION
       This  manual  page  documents  the GNU version of updatedb, which updates file name databases used by GNU locate.  The file name databases contain lists of files that were in particular directory
       trees when the databases were last updated.  The file name of the default database is determined when locate and updatedb are configured and installed.  The frequency with which the databases are
       updated and the directories for which they contain entries depend on how often updatedb is run, and with which arguments.

       In  networked  environments,  it often makes sense to build a database at the root of each filesystem, containing the entries for that filesystem.  updatedb is then run for each filesystem on the
       fileserver where that filesystem is on a local disk, to prevent thrashing the network.  Users can select which databases locate searches using an environment variable or command line option;  see
       locate(1).  Databases cannot be concatenated together.

       The @samp{LOCATGE02} database format was introduced in GNU findutils version 4.0 in order to allow machines with different byte orderings to share the databases.  GNU locate can read both the old
       and @samp{LOCATE02} database formats, though support for the old pre-4.0 database format will be removed shortly.

OPTIONS
       --findoptions='-option1 -option2...'
              Global options to pass on to find.  The environment variable FINDOPTIONS also sets this value.  Default is none.

       --localpaths='path1 path2...'
              Non-network directories to put in the database.  Default is /.

       --netpaths='path1 path2...'
              Network (NFS, AFS, RFS, etc.) directories to put in the database.  The environment variable NETPATHS also sets this value.  Default is none.

       --prunepaths='path1 path2...'
              Directories to not put in the database, which would otherwise be.  Remove any trailing slashes from the path names, otherwise updatedb won´t recognise the paths you want to  omit  (because
              it uses them as regular expression patterns).  The environment variable PRUNEPATHS also sets this value.  Default is /tmp /usr/tmp /var/tmp /afs.

       --prunefs='path...'
              File systems to not put in the database, which would otherwise be.  Note that files are pruned when a file system is reached; any file system mounted under an undesired file system will be
              ignored.  The environment variable PRUNEFS also sets this value.  Default is nfs NFS proc.

       --output=dbfile
              The database file to build.  Default is system-dependent.  In Debian GNU/Linux, the default is /var/cache/locate/locatedb.

       --localuser=user
              The user to search non-network directories as, using su(1).  Default is to search the non-network directories as the current user.  You can also use the environment variable  LOCALUSER  to
              set this user.

       --netuser=user
              The user to search network directories as, using su(1).  Default is daemon.  You can also use the environment variable NETUSER to set this user.

       --dbformat=F
              Create  the  database in format F.  The default format is called LOCATE02.  Alternatively the slocate format is also supported.  When the slocate format is in use, the database produced is
              marked as having security level 1.  If you want to build a system-wide slocate database, you may want to run updatedb as root.

       --version
              Print the version number of updatedb and exit.

       --help Print a summary of the options to updatedb and exit.

SEE ALSO
       find(1), locate(1), locatedb(5), xargs(1)

       The full documentation for updatedb is maintained as a Texinfo manual.  If the info and updatedb programs are properly installed at your site, the command info updatedb should give you access  to
       the complete manual.

COPYRIGHT
       Copyright © 1994-2019 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later .
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.

BUGS
       The  updatedb program correctly handles filenames containing newlines, but only if the system's sort command has a working -z option.  If you suspect that locate may need to return filenames con‐
       taining newlines, consider using its --null option.

       The best way to report a bug is to use the form at https://savannah.gnu.org/bugs/?group=findutils.  The reason for this is that you will then be able to track  progress  in  fixing  the  problem.
       Other comments about updatedb(1) and about the findutils package in general can be sent to the bug-findutils mailing list.  To join the list, send email to bug-findutils-request@gnu.org.

                                                                                                                                                                                               UPDATEDB(1)

Моя текущая команда с помощью старых разновидностей updatedb:

updatedb -l 0 -o /path/to/some/locate.db -U /path/to/some/dir/to/be/scanned

Таким образом, основной вопрос, который я имею, является этим: Где указать/path/to/some/dir/to/be/scanned использование новой версии updatedb?

Ну, это - вероятно, одна из этих двух опций:

       --localpaths='path1 path2...'
              Non-network directories to put in the database.  Default is /.

       --netpaths='path1 path2...'
              Network (NFS, AFS, RFS, etc.) directories to put in the database.  The environment variable NETPATHS also sets this value.  Default is none.

Но они не разъясняют, каков "netpath". У меня действительно есть смесь выполнений, посредством чего/path/to/some/dir/to/be/scanned является локальным каталогом на ноутбуке, и в других случаях, каталог является тем, который находится на смонтированный NFS раздел в сети.

0
задан 24 October 2019 в 18:21

2 ответа

Опция, которую я закончил тем, что использовал, --localpaths. Я разочаровался --netpaths на данный момент, пока кто-то не может описать то, для чего используется последний.

0
ответ дан 22 December 2019 в 00:13

У меня есть те же проблемы - некоторый сценарий должен быть изменен соответственно и излишне.

Я первоначально думал, что это была новая версия, располагаются / обновление. Вместо этого я обнаружил, что это - busybox версия updatedb/locate, который делает то же самое, но по-другому.

Я должен был установить "mlocate" для решения этого!

0
ответ дан 22 December 2019 в 00:13

Другие вопросы по тегам:

Похожие вопросы: