Lantronix Computer Hardware LX6 User Manual

Page of 87
4: Configuration Using XML
XPort® Pro Lx6 Embedded Device Server Command Reference
19
Importing
The following syntax can be used to import configurations from a file:
xcr import <file> 
xcr import <file> <groups and/or group:instances> 
The first line imports all groups specified in the XML config record named in <file>. Any filename is 
valid, and the file name and extension are not important. 
In the second line:
Instance follows group with a colon (see the third example on the next page).
Multiple groups are separated with a comma.
Any white space requires the list of groups to be quoted.
Only the named groups get imported, even if the XCR contains additional XCR groups.
The following syntax can be used to export configurations to a file on the device server's file 
system:
xcr export <file> 
xcr export <file> <groups and/or group:instances>
The same guidelines above regarding importing configurations also apply to exporting 
configurations. If no groups are specified, then the export command will export all configuration 
settings to the file. If instances are specified after the groups, only those group instances are 
written. If no instance is specified, all instances of that group are written.
Exporting
The following example exports only the accept mode tunneling settings for  1 to the file 
"tunnel_1.xcr" on the device server filesystem:
xcr export tunnel_1.xcr "tunnel accept:1" 
The following example exports only the mode tunneling settings for all  to the file "tunnel_all.xcr" 
on the device server filesystem:
xcr export tunnel_all.xcr "tunnel "
The following example imports only the settings for 2 from an XCR named "factory_config.xcr" on 
the device server filesystem. If "factory_config.xcr" has other configuration settings, they are 
ignored:
xcr import factory_config.xcr ":2" 
The following example imports only  settings for all  from a configuration record on the device 
server filesystem named "foobar.xcr":
xcr import foobar.xcr ""
To import only  mode tunnel settings for  1 and all  settings for  2 from an XML configuration record 
named "production.xcr" that contains these settings (and possibly more), issue the following 
command:
xcr import production.xcr "tunnel :1"
The following example exports  mode tunneling for all  to the file tunnel_config.xcr on the device 
server filesystem:
xcr export tunnel_config.xcr "tunnel"