TapeTrack Documentation

Because there is more to tape management than you ever realized

User Tools

Site Tools


sync:definition

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sync:definition [2021/06/03 04:35] – [Setting Literal Values] Scott Cunliffesync:definition [2025/01/21 22:07] (current) – external edit 127.0.0.1
Line 21: Line 21:
 ==== CSV Source File ==== ==== CSV Source File ====
  
-sample CSV file: CSV_source.csv+sample CSV file: ''CSV_source.csv''
  
   volume,barcode,family,type,location,pool   volume,barcode,family,type,location,pool
-  000000L6,000000L6,tape,LTO,Library,weekly_full +  000000L6,000000L6,tape,LTO,Library,weekly_full,2021-07-21 
-  000001L6,000001L6,tape,LTO,Offsite,weekly_full +  000001L6,000001L6,tape,LTO,Offsite,weekly_full,2021-10-14 
-  000002L6,000002L6,tape,LTO,Offsite,weekly_full +  000002L6,000002L6,tape,LTO,Offsite,weekly_full,2021-07-21 
-  000003L6,000003L6,tape,LTO,Offsite,weekly_full +  000003L6,000003L6,tape,LTO,Offsite,weekly_full,2021-07-21 
-  000004L6,000004L6,tape,LTO,Racking,weekly_full +  000004L6,000004L6,tape,LTO,Racking,weekly_full,2021-10-14 
-  000005L6,000005L6,tape,LTO,Library,weekly_full +  000005L6,000005L6,tape,LTO,Library,yearly_full,1970-01-01 
-  000006L6,000006L6,tape,LTO,Racking,weekly_full +  000006L6,000006L6,tape,LTO,Racking,weekly_full,2021-07-21 
-  000007L6,000007L6,tape,LTO,Racking,weekly_full+  000007L6,000007L6,tape,LTO,Racking,weekly_full,2021-10-14 
 +  CLN00012,CLN00012, CLN,LTO,,Cleaning_Tape,
      
 === Add File Type Directives === === Add File Type Directives ===
Line 42: Line 43:
  
 Skip any line starting with volume, as it is a heading and not a Volume Skip any line starting with volume, as it is a heading and not a Volume
 +Skip any Volume that starts with CLN.
  
   AddString(EXCLUSION, 0, "volume*");   AddString(EXCLUSION, 0, "volume*");
-  +  AddExclusionOnValue(VOLUME, "CLN*");
  
  
Line 54: Line 56:
   setLiteral(CUSTOMER, "ACME");   setLiteral(CUSTOMER, "ACME");
   setLiteral(MEDIA, "LTO");   setLiteral(MEDIA, "LTO");
 +  setLiteral(SCRATCH, "True");
 +  
 +==== Define Fields ====
 +
 +Definition fields to pass date format to Sync engine, Y=YYYY (y-YY), m=mm, d=dd.
 +Permanent date value sets the specified date to Permanent or no next move date.
 +
 +  SetMoveDateFormat("%%Y/%%m/%%d");
 +  SetPermanentDateValue("1971-01-01");
  
  
Line 67: Line 78:
 Extract Location from column 4, length 20 Extract Location from column 4, length 20
 Remove spaces from location in case it is less than 20 digits Remove spaces from location in case it is less than 20 digits
- +
   Extract(REPOSITORY, 4, 20, 0);   Extract(REPOSITORY, 4, 20, 0);
   RemoveSpaces(REPOSITORY);   RemoveSpaces(REPOSITORY);
Line 77: Line 88:
   RemoveSpaces(DESCRIPTION);   RemoveSpaces(DESCRIPTION);
      
 +Extract Movedate from column 5, length 11
 +
 +  Extract(MOVEDATE, 5, 11, 0);
 +==== 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);
 +  
 +  SetMoveDateFormat("%%Y/%%m/%%d");
 +  Extract(MOVEDATE, 5, 11, 0);
 +  
 +  AddString(EXCLUSION, 0, "volume*");
 +  AddExclusionOnValue(VOLUME, "CLN*");
 +  
 +  AddTranslation(REPOSITORY, "Offsite", "OFFS");
 +  AddTranslation(REPOSITORY, "Library", "LIBR");
 +  AddTranslation(REPOSITORY, "Racking", "RACK");
 +  
 +  AddTranslation2(SCRATCH, REPOSITORY, "OFFS", "False");
      
 +<- sync:fields| Sync Fields ^ sync:introduction|introduction ^ sync:execute|Run Sync ->
  
sync/definition.1622694930.txt.gz · Last modified: 2025/01/21 22:07 (external edit)