This is an old revision of the document!
Table of Contents
Add Remove Flags Based Off Last Read Time
Add or Remove Flags based off last read time of Volumes using TMSS10ModifyFlags and a config file.
The purpose of this method allows you to lock any Volumes in your Library that have been recalled for data restoration and then automatically remove the move lock once the last read time passes a set number of days. The Sync can then place the Volumes in a move back to the offsite vault until the data expires.
The process involves TMSS10ModifyFlags loading an input file, using a definition file, to extract the Volume-ID's. The Volume-ID's are then filtered using the configuration file and adding any qualifying Volumes to a scan file.
The scan file is then processed, adding or removing the defined Flags against the scan list Volumes.
Sample Files
Input file - Volumes.csv
001,OFFS,2021/07/15 22:10:33 002,OFFS,2021/07/15 22:10:34 003,OFFS,2021/07/15 22:10:35 004,OFFS,2021/07/15 22:10:36 005,OFFS,2021/07/15 22:10:37 006,OFFS,2021/06/15 22:10:38 007,OFFS,2021/06/16 22:10:39 008,OFFS,2021/06/17 22:10:40 009,OFFS,2021/06/18 22:10:41 010,OFFS,2021/06/19 22:10:42
Definition file - default.ttidef
The definition file provides the information on how to extract the Volume-ID from the input file into the barcode field, as well as setting the Customer-ID and Media-ID.
# Set input file (use full path if not in current directory) setFile(volumes.csv); # Set delimiter used in CSV file setCSVDelimiter(","); # Set Customer-ID setLiteral(CUSTOMER, 0002); #Set Media-ID setLiteral(MEDIA, LTO); # Extract Volume-ID into BARCODE field extract(BARCODE, 1, 3, 0);
Configuration file - last_read.cfg
Configuration file sets definition file for translating and extracting Volume-ID's and filters input by Customer-ID (0002), Media-ID (LTO). The last read time is then compared to the lastreadtime filter, if the last read time is 30 or more days ago, the Volume is added to the scan file, if not it is discarded.
traversal = { scanfile= { file="default.ttidef"; }; customer = ( { id="0002"; media = ( { id="LTO"; volume = ( { id="*"; lastreadtime = "P:*-30"; skip=false; }, { id="*"; skip=true; } ); } ); } ); };
Batch file - run_remove_lock_flag.bat
Run TMSS10ModifyFlags to remove lock flag from all Volumes in the input file with a last read date of 30 or more days ago. Using the Volume filter (-V) to only read in Customer-ID 0002 to save processing time by avoiding reading in all other Customer-ID's. Output from the process being written to stdout.txt and stderr.txt. The output files can written to any directory by using full directory paths.
TMSS10ModifyFlags -S user:-password@server -F "!l" -c last_read.cfg -V 0002.LTO.* > stdout.txt 2> stderr.txt