The exportObjects script

The exportObjects script lets you export objects. This function is similar to exporting tasks using the user interface, but in addition to exporting objects and their references, this script also exports associated configuration files and control files. By default, the script creates a ZIP file in the working directory as output.

Usage

exportObjects -t ObjectType ObjectId [ObjectId]... [option]...

Element Required? Description
-t ObjectType Yes

Specify one object type. These object types can be exported. Specify them as shown here:

  • BarcodeFormat
  • Group
  • InputDevice
  • InserterSystem
  • InsertPlan
  • JobType
  • Location
  • Material
  • NonProduction
  • Policy
  • Printer
  • Selector
  • StepTemplate
  • User

You can repeat the pattern -t Object Type Object ID [Object ID]multiple times.

ObjectId [ObjectId]... Yes, 1+

Specify at least one object ID that you want to export; for example, if you specified StepTemplate as the object type, list the name of each step template that you want to export. If the list is long, you can use the -f option described below to get the object IDs from a file instead.

[option]... No

Specify one or more options:

-f file_name
Inserts the content of the file into the command. The specified file must be in the same directory that you are working in.
-d dir_name
Searches the specified directory for configuration files or control files used by the object(s) being exported.
-o output_file_name
Creates an output file with the specified name instead of the default name (ExportedObjects.zip). The file name can be an absolute file name or a path relative to the current directory.
-h
Shows the script usage help text.

In this simple example, the job types AFP and AddDocuments are exported:

exportObjects -t JobType AFP AddDocuments

The command can also be partially contained in a file. In the next example, the inserter system IDs are contained in a file named InserterSystemIds.txt:

exportObjects -t JobType AFP -t InserterSystem -f InserterSystemIds.txt -o /tmp/exports.zip

The file InserterSystemIds.txt contains a list of inserter system IDs:

PitneySample
GuntherSample

The command can also be completely included in a file:

exportObjects -f command.txt

When creating a text file with the command information, note that the -t and the object type must be on the same line, and the object IDs must be on separate lines. Object IDs that contain spaces do not need to be wrapped in double quotes if they are referenced from a file.

-t JobType
AFP
AddDocuments
-t Selector
MondayAt9
-t InserterSystem
PitneySample
GuntherSample
-o /tmp/exports.zip

Exporting insert plans

When exporting insert plans, you must identify them by name and date. The date must be in the format YYYY-MM-DD and fall within the range of the insert plan to be exported. For an insert plan with the name "Insert Plan 1", cycle start date 2010-02-02, and cycle end date 2010-12-12, refer to it as:

Insert Plan 1 2010-04-04

If an insert plan references a material, the material will not be exported automatically; include it in the command using the object type of Material.