Saving Unload Options to a File
You can use the @file
option to save a set of reusable settings to plug into a ybunload
operation. You cannot use @file
to save and re-run an entire ybunload
specification.
Note: To save an unload query to a file, use the --select-file
option.
To save and use options files with @file
:
Determine the set of options that works to unload a particular data set.
Check that these options are appropriate by unloading the data once in the usual way.
Save the options to a text file in a location that is accessible to the
ybunload
client. For example:
$ more myoptions.txt
-d
premdb
--username
bobr
--format
text
-o
/home/ybdata/premdb_unloads
--prefix
match
Note: The name of an option and its value must be on separate lines in the file.
- Run the
ybunload
command with the@file
option:
$ ybunload @/home/ybdata/myoptions.txt -W --truncate-existing
Database login password:
16:24:16.209 [ INFO] ybunload version 5.4.0-20220228155915
16:24:16.211 [ INFO] COMMAND LINE = @/home/ybdata/myoptions.txt -W --truncate-existing
16:24:16.211 [ INFO] Verifying unload statement...
16:24:16.292 [ INFO] Unload statement verified
16:24:16.296 [ INFO] Beginning unload to /home/ybdata/premdb_unloads
16:24:17.090 [ INFO] Network I/O Complete. Waiting on file I/O
16:24:17.094 [ INFO] Finalizing...
16:24:17.096 [ INFO] Transfer complete
16:24:17.098 [ INFO] Transferred: 302.19 KB Avg Network BW: 21.09 MB/s Avg Disk write rate: 15.53 MB/s
Parent topic:ybunload Command