TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


sync:definition
 
 

This is an old revision of the document!


Sync Definition Files

Sync definition files, have a file suffix of .ttidef and can be edited using a plain text editor such as Notepad or vi.

The purpose of a definition file is to provide the translations to TapeTrack on how to extract the required information from the source file, including location and format of the data.

All TapeTrack command line programs, including Sync, will look for a definition file named default.ttidef in the directory they are executed in unless the name and location of the definition file is named in the program call.

Creating A Definition File

Using a text file editor create a file, using a descriptive name, with a suffix .ttidef (eg customer_ACME.ttidef).

In Windows install, save this file to the TapeTrack\TapeTrack Sync\etc directory. You will also notice a sample ttidef file here that was created when Sync was installed.

Adding Definition Statements

The definition statements required vary on the format of the source file, what information is required for extraction and translations needed on the extracted data.

CSV Source File

sample CSV file: CSV_source.csv

volume,barcode,family,type,location,pool
000000L6,000000L6,tape,LTO,Library,weekly_full
000001L6,000001L6,tape,LTO,Offsite,weekly_full
000002L6,000002L6,tape,LTO,Offsite,weekly_full
000003L6,000003L6,tape,LTO,Offsite,weekly_full
000004L6,000004L6,tape,LTO,Racking,weekly_full
000005L6,000005L6,tape,LTO,Library,weekly_full
000006L6,000006L6,tape,LTO,Racking,weekly_full
000007L6,000007L6,tape,LTO,Racking,weekly_full

Add File Type Directives

As we are using a comma delimitered CSV file we let the Sync engine know what the delimiter is.

setCSVDelimiter(",");

Add Exclusion Directives

Skip any line starting with volume, as it is a heading and not a Volume

AddString(EXCLUSION, 0, "volume*");

Setting Literal Values

Sync constants, such as Customer-ID and Media-ID, can be set using literal values as these values do not change. Set Scratch to true.

setLiteral(CUSTOMER, "ACME");
setLiteral(MEDIA, "LTO");
setLiteral(SCRATCH, "True");

Extract Data Fields

Extract Volume-ID from column 1, length 10 Remove spaces from Volume-ID in case it is less than 10 digits

Extract(VOLUME, 1, 10, 0);
RemoveSpaces(VOLUME);

Extract Location from column 4, length 20 Remove spaces from location in case it is less than 20 digits

Extract(REPOSITORY, 4, 20, 0);
RemoveSpaces(REPOSITORY);

Extract Description from column 5, length 30 Remove Spaces from Description in case it is less then 30 characters

Extract(DESCRIPTION, 5, 30, 0);
RemoveSpaces(DESCRIPTION);

Translate Fields Directly

Translate Repository data to TapeTrack Repository-ID's Offsite = OFFS Library = LIBR Racking = RACK

AddTranslation(REPOSITORY, "Offsite", "OFFS");
AddTranslation(REPOSITORY, "Library", "LIBR");
AddTranslation(REPOSITORY, "Racking", "RACK");

Translate Fields Indirectly

Translate Scratch value, set to False if Volume location is Offsite

AddTranslation2(SCRATCH, REPOSITORY, "OFFS", "False");

Complete Definition File

setCSVDelimiter(",");

setLiteral(CUSTOMER, "ACME");
setLiteral(MEDIA, "LTO");
setLiteral(SCRATCH, "True");

Extract(VOLUME, 1, 10, 0);
RemoveSpaces(VOLUME);

Extract(REPOSITORY, 4, 20, 0);
RemoveSpaces(REPOSITORY);

Extract(DESCRIPTION, 5, 30, 0);
RemoveSpaces(DESCRIPTION);

AddTranslation(REPOSITORY, "Offsite", "OFFS");
AddTranslation(REPOSITORY, "Library", "LIBR");
AddTranslation(REPOSITORY, "Racking", "RACK");

AddTranslation2(SCRATCH, REPOSITORY, "OFFS", "False");
sync/definition.1622695605.txt.gz · Last modified: 2025/01/21 22:07 (external edit)