Cisco Systems OL-27172-01 Mobility Aid User Manual


 
20-2
Cisco Broadband Access Center 3.8 Administrator Guide
OL-27172-01
Chapter 20 Cisco BAC Support Tools and Advanced Concepts
Using the deviceExport.sh Tool
You can generate the list of properties predefined in Cisco BAC and available for export by running the
deviceExport.sh -samplectrl command. (For sample control output, see Example 20-2.)
The CSV format is used widely to exchange data between applications. Keep the following rules in mind
about a CSV format file:
Each device outputs to one line.
Each line terminates with the UNIX format line separator (\n).
Each field is separated by a comma (,).
If a field contains white space, a comma, or a line separator, it is enclosed by double quotes ("). If
a field contains double-quotes, repeat the character twice to escape it; for instance, "file name"
becomes ""file name"".
A boolean field outputs as true or false.
A byte array outputs to a string with UTF-8 encoding.
If a field is a list, it converts into a formatted string with each item separated by comma; for instance,
a node list outputs as "node1, node2, node3".
If a field is a map, it is converted into a long string. The key and data is separated by a comma; for
instance, a map output looks like: "(key1, data1)(key2, data2)(key3, data3)".
If the field value is null or does not exist, the output is an empty string followed by a comma.
The first line is the field name separated by a comma.
There is no comma at the end of each record.
Example 20-1 Sample CSV Format
74:7b:7b:f0:e7:80,admin,true,2,"node1,node2,node3","(prop1,value1)(prop2,value2)",,,
Syntax Description To use the deviceExport.sh command, use this syntax:
# ./deviceExport.sh [–help] [–samplectrl] controlfile backupdir outputdir
controlfile—Identifies the path to the control file, which defines the fields required for export.
backupdir—Identifies the path to the directory, which contains backed-up database files that are to
be used as data source. (To back up your database, use the backupDb.sh tool; see Backup and
Recovery, page 10-4.)
outputdir—Identifies the target location for the output files. If the directory does not exist, a new
directory is created.
help—Generates tool usage information.
samplectrl—Generates the sample control file, which contains the supported properties and device
types, in the current directory. The control file is an XML file that contains the supported properties
and device types. You can remove unwanted properties or choose to export only certain types of
devices by editing the XML file. See Example 20-2 for output of a sample control file.
Example 20-2 Sample Control File
# ./deviceExport.sh –samplectrl
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE CONTROLFILE SYSTEM "device-export-control.dtd">
<!--SAMPLE CONTROL FILE-->