====== Managing Scratch Volumes With TMSS10LibraryManager ======
[[cli:tmss10librarymanager|TMSS10LibraryManager]] is used to automatically manage Scratch [[object:volume|Volume]] levels for your Backup Library.
Steps to set up management:
* Set Library Repository Capacities.
* Set Scratch Repository preferences.
* Designate a Target Repository to eject Library [[object:volume|Volume]] to when space is required.
* Create a batch file
* Schedule batch file to run automatically
===== Set Library Capacities =====
Open TapeMaster, select the required Customer and Media Type from the Customer Tree.
For this example we will use Customer-ID US01 and Media-ID LTO along with the Repository-ID LIBR.
{{customer_tree_us01.png}}
Right click on the Repository and select ''Properties'' to open the Properties window.
{{select_repository_properties.png}}
Select the ''Options'' tab.
{{repository_properties_options.png}}
Towards the bottom, expand the Capacity section by clicking on the + sign.
In the field ''Capacity'', enter the number of [[object:volume|Volume]] Slots in your Library.
In the field ''Minimum Scratch'' enter the minimum number of Scratch [[object:volume|Volumes]] required in the Library.
{{repository_capacity.png}}
Click ''Save'' to update the Repository data.
===== Set Scratch Repository Preferences =====
From the other Repositories within the Customer's Media Type, decide the Repositories that Scratch [[object:volume|Volumes]] should be harvested from and in what order. The higher the Scratch Priority the more preference it is given for Scratch selection. Any Repository with a Scratch Priority of 0 will not be used for Scratch [[object:volume|Volume]] selection.
To set the Scratch Priority of the Repository your Scratch [[object:volume|Volumes]] will be selected from, right click on the required Repository and select ''Properties''.
{{repository_properties_options_rack.png}}
Select the ''Options'' tab.
{{repository_properties_options_tab_rack.png}}
In the field ''Scratch Priority'' set the required number, remembering the higher the number the earlier it is used for Scratch [[object:volume|Volume]] selection.
{{repository_properties_options_rack_scratch.png}}
Click ''Save'' to update the Repository data.
===== Create a Scheduled File =====
==== Windows Batch File ====
Open a new Notepad file and click File > Save As to open up the File Save dialog.
Save the file under and appropriate name, such as runTMSSLibraryManager.bat
Select ''All Types'' from the Save As Type drop box.
{{save_batch_file.png}}
Click Save to create the batch file.
==== Add Command Line Code to Scheduled File ====
=== Minimum requirements for the Command Line code include: ===
* Program call [[cli:tmss10librarymanager|TMSS10LibraryManager]].
* [[cli:server_argument|Logon string (-S user:-pass@server)]].
* [[object:customer|Customer-ID (-C XXXX)]].
* [[object:media|Media-ID (-M XXXX)]].
* [[object:repository|Repository-ID to manage (-R XXXX)]].
Using the minimum requirements [[cli:tmss10librarymanager|TMSS10LibraryManager]] will attempt to load the required Scratch [[object:volume|Volumes]] for the managed Repository, based off the Repository settings in TapeTrack. As no Target Repository is set, no [[object:volume|Volumes]] will be ejected to make room for incoming [[object:volume|Volumes]].
If Notepad is still open, type the code below, replacing the login values, Customer-ID, Media-ID and Repository-ID to your own values. If the file is not open, right click on the file and select ''Edit'' to open.
{{open_batch_file.png}}
Using the example Customer-ID US01 and Media-ID LTO along with the Repository-ID LIBR:
TMSS10LibraryManager -S user:-pass@serveraddress -C "US01" -M "LTO" -R "LIBR"
=== Additional options include ===
* Target Repository to eject [[object:volume|Volumes]] to (-T XXXX). Setting this value will allow [[cli:tmss10librarymanager|TMSS10LibraryManager]] to eject qualifying [[object:volume|Volumes]] to make room for incoming Scratch Volumes if required.
* [[object:volume|Volume]] Selection Filter to include only [[object:volume|Volumes]] that match (-V). A filter of *L6 will prune the list of all available [[object:volume|Volumes]] to only those that end in L6, eg. 100100L6.
* Configuration file (-c).
* [[object:volume|Volume]] ejection exclusion filter (-e). A filter value of *L5 will exclude all [[object:volume|Volumes]] that end in L5 from being ejected from the Library, eg 100100L5.
* Minimum free slots required in Repository (-f). This value is used to calculate how many [[object:volume|Volumes]] will need to be ejected to make room for the required Scratch [[object:volume|Volumes]] and still maintain the set number of empty slots in the Library.
* Repository Scratch order override (-r). Allows you to override the Scratch Priority set through TapeMaster. This can be useful when running [[cli:tmss10librarymanager|TMSS10LibraryManager]] for multiple Libraries, allowing the selection of Scratch [[object:volume|Volumes]] to be directed to different Repositories for each Library if required.
* Minimum Scratch [[object:volume|Volumes]] required in Repository (-s). Allows you to override the minimum Scratch [[object:volume|Volume]] number set in TapeMaster
Using the example Customer-ID US01, Media-ID LTO, Repository-ID LIBR, along with specifying the Repository OFFS to eject any [[object:volume|Volumes]] to. Allow 5 free slots in the Library with a minimum 8 Scratch [[object:volume|Volumes]], ensuring no L5 [[object:volume|Volumes]] are ejected. Overriding the Scratch Priority to stop selecting Scratch [[object:volume|Volumes]] from RAC1 to selecting them from RAC2
TMSS10LibraryManager -S user:-pass@serveraddress -C "US01" -M "LTO" -R "LIBR" -T "OFFS" -f 5 -s 8 -r "RAC1=0;RAC2=10"
=== Redirecting output to file ===
[[cli:tmss10librarymanager|TMSS10LibraryManager]] outputs, by default, reports to standard out and diagnostic information to standard error. This information can be captured and redirected to file using the redirection pipes > and 2>.
To redirect the reports to LibraryManager_Reports_stdout.txt and diagnostic information to LibraryManager_Diagnostic_stderr.txt.
TMSS10LibraryManager -S user:-pass@serveraddress -C "US01" -M "LTO" -R "LIBR" > LibraryManager_Reports_stdout.txt 2> LibraryManager_Diagnostic_stderr.txt
==== Schedule Batch File ====
On Windows, [[technote:windows_scheduler|Task Scheduler]] is a tool that allows you to create and run virtually any task automatically.
Tasks, such as [[cli:tmss10librarymanager|TMSS10LibraryManager]] should be scheduled to run from either the Server where the TapeTrack Server is installed, or another Server that runs continually so the execution of the task is not hindered by a computer that may not be running when the task is due to be run.
See [[technote:windows_scheduler|Windows Task Scheduler]] for details on how to schedule the batch file for execution.