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:

  1. Determine the set of options that works to unload a particular data set.
  2. Check that these options are appropriate by unloading the data once in the usual way.
  3. 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.
  4. 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 1.2.2-5653
    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