table of contents
SYSTEMD-VPICK(1) | systemd-vpick | SYSTEMD-VPICK(1) |
NAME¶
systemd-vpick - Resolve paths to ".v/" versioned directories
SYNOPSIS¶
systemd-vpick [OPTIONS...] [PATH...]
DESCRIPTION¶
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.
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.
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.
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.
OPTIONS¶
The following options are understood:
--basename=, -B
Added in version 256.
-V
Added in version 256.
-A
Added in version 256.
--suffix=, -S
Added in version 256.
--type=, -t
Added in version 256.
--print=, -p
Added in version 256.
--resolve=
Added in version 256.
-h, --help
--version
EXAMPLES¶
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/
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.
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/
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.
For further examples see systemd.v(7).
EXIT STATUS¶
On success, 0 is returned, a non-zero failure code otherwise.
SEE ALSO¶
systemd 256.8 |