| SYSTEMD-VPICK(1) | systemd-vpick | SYSTEMD-VPICK(1) |
.SH "NAME" systemd-vpick - Resolve paths to .v/ versioned
directories
.SH "SYNOPSIS"
.HP 888u
systemd-vpick [OPTIONS...] [PATH...]
.SH "DESCRIPTION"
.PP systemd-vpick resolves a file system path referencing a .v/
versioned directory to a path to the newest (by version) file contained
therein. This tool provides a command line interface for the
systemd.v(7) logic.
.PP The tool expects a path to a .v/ directory as argument (either directly,
or with a triple underscore pattern as final component). It then determines
the newest file contained in that directory, and writes its path to standard
output.
.PP Unless the triple underscore pattern is passed as last component of the
path, it is typically necessary to at least specify the --suffix=
switch to configure the file suffix to look for.
.PP If the specified path does not reference a .v/ path (i.e. neither the
final component ends in .v, nor the penultimate does or the final one does
contain a triple underscore) its specified path is written unmodified to
standard output.
.SH "OPTIONS"
.PP The following options are understood:
.PP --basename=, -B
Overrides the "basename" of the files to look for, i.e. the part to
the left of the variable part of the filenames. Normally this is derived
automatically from the filename of the .v component of the specified path,
or from the triple underscore pattern in the last component of the specified
path.
Added in version 256.
.RE
.PP -V
Explicitly configures the version to select. If specified, a filename with
the specified version string will be looked for, instead of the newest
version available.
Added in version 256.
.RE
.PP -A
Explicitly configures the architecture to select. If specified, a filename
with the specified architecture identifier will be looked for. If not
specified, only filenames with a locally supported architecture are
considered, or those without any architecture identifier.
Added in version 256.
.RE
.PP --suffix=, -S
Configures the suffix of the filenames to consider. For the .v/ logic it is
necessary to specify the suffix to look for, and the .v/ component must also
carry the suffix immediately before .v in its name.
Added in version 256.
.RE
.PP --type=, -t
Configures the inode type to look for in the .v/ directory. Takes one of reg,
dir, sock, fifo, blk, chr, lnk as argument, each identifying an inode type.
See inode(7) for details about inode types. If this option is used
inodes not matching the specified type are filtered and not taken into
consideration.
Added in version 256.
.RE
.PP --print=, -p
Configures what precisely to write to standard output. If not specified,
prints the full, resolved path of the newest matching file in the .v/
directory. This switch can be set to one of the following:
.sp
Added in version 256.
.RE
.PP --resolve=
Takes a boolean argument. If true the path to the versioned file is fully
canonicalized (i.e. symlinks resolved, and redundant path components
removed) before it is shown. If false (the default) this is not done, and
the path is shown without canonicalization.
Added in version 256.
.RE
.PP -h, --help
Print a short help text and exit.
.RE
.PP --version
Print a short version string and exit.
.RE
.SH "EXAMPLES"
.PP Use a command like the following to automatically pick the newest raw
disk image from a .v/ directory:
$ systemd-vpick --suffix=.raw --type=reg /var/lib/machines/quux.raw.v/
.PP This will enumerate all regular files matching
/var/lib/machines/quux.raw.v/quux*.raw, filter and sort them according to
the rules described in systemd.v(7), and then write the path to the
newest (by version) file to standard output.
.PP Use a command like the following to automatically pick the newest OS
directory tree from a .v/ directory:
$ systemd-vpick --type=dir /var/lib/machines/waldo.v/
.PP This will enumerate all directory inodes matching
/var/lib/machines/waldo.v/waldo*, filter and sort them according to the
rules described in systemd.v(7), and then write the path to the
newest (by version) directory to standard output.
.PP For further examples see systemd.v(7).
.SH "EXIT STATUS"
.PP On success, 0 is returned, a non-zero failure code otherwise.
.SH "SEE ALSO"
.PP systemd(1), systemd.v(7)
| systemd 262.2 |