Automating Millennium and telnet tasks using Windowsbased scripting
Automating Millennium and telnet tasks using Windows-based scripting Christina L. Hennessey Systems Librarian Loyola Marymount University Innovative Users Group Conference May 2006, Denver, CO Sessions F 2 & P 5
Background information • • Loyola Marymount University, Los Angeles, CA Private Jesuit institution 5, 508 undergraduates, 1, 464 post-graduates Systems Librarian Systems department: 2 people No Systems department before 2003 LMU has been III since 1990 Millennium Silver 2
Why should you automate tasks? • Tired of doing the same boring, repetitive tasks • Less chance for human error • Cut down on repetitive stress injuries • Tasks you forget to do • Tasks you do every day • Tasks you don’t do often 3
Candidates for automation • • • Initializing the backup tape Monthly statistics Weekly/monthly/daily file loads Printing balances after posting Printing daily circ stats Any task you perform often with many repetitive steps 4
What you need • • Scripting software (free!) List the steps in your task Little to no programming experience Sample data to work with (that won’t mess up your system) Windows computer Text editor (Notepad okay) Optional: Scheduling software Optional: Automatic emailer 5
Windows Script • Sends simple commands to Windows programs • Download free from Microsoft here: http: //msdn. microsoft. com/library/default. a sp? url=/downloads/list/webdev. asp • Script Center for more info: http: //www. microsoft. com/technet/scriptce nter/default. mspx 6
A simple telnet script: initialize the backup tape every day at 11 pm • • • Start telnet (or Anzio. Win) Send passwords Send keys (A, B) Send more passwords Send more keys (U, I, F, I, Y, Q, Q, X) • Send me an email when it is done 7
Automating Initializing the Backup Tape • Windows Scripting code sample, demo: http: //lib. lmu. edu/chennessey/iug 2006/Initialize. Backup. Ta pe. htm • Run this file: wscript //e: vbscript <location of the script> <logon pwd> <init pwd> 8
Automating Initializing the Backup Tape • Customize with your server name, telnet program, and keystrokes • Wsh. Shell. Send. Keys • WScript. Sleep 9
Scheduling the task • To run the task at a certain time: a. call the Windows Script file from a batch file b. call the batch file from your scheduling software 10
Calling your script from a batch file • Include the call to your script: wscript //e: vbscript <location of the script> <arg 1> <arg 2> • Add anything else you want to happen before or after the script (email, warning message) 11
Scheduling your task • Windows Scheduler • Start->Programs->Accessories->System Tools->Scheduled Tasks • Add Scheduled Task 12
Email when the task is complete • Blat is a free Windows command-line utility for sending email • Open-source • http: //www. blat. net/ • Can also email from a Windows Script (more difficult) 13
Emailing yourself from a batch file Add this Blat line to the end of your batch file: Blat - -body "Backup tape initialization complete" -t "chennessey@lmu. edu" -s "Backup tape initialization Complete“ Full blat syntax available at http: //www. blat. net or by typing ‘blat’ 14
Another telnet task: print system stats • Start telnet (or Anzio. Win) • Send passwords • Send keys (M, I, F, S, P, 1, Q; X, D, P, 1, Q, Q; D, P, 1, Q; C, P, 1, Q; A, P, 1, Q; Q, Q, Q, X) • Send me an email when it is done 15
Automating Printing System Stats • Windows Scripting code sample, demo: http: //lib. lmu. edu/chennessey/iug 2006/Print. System. Stats. htm • Run this file: wscript //e: vbscript <location of the script> <logon pwd> <initials pwd> 16
Auto. It • BASIC-like scripting language that automates the Windows GUI: keystrokes, mouse movement • Freeware • Download here: http: //www. autoitscript. com/autoit 3/ 17
Automating Millennium tasks using Auto. It • Millennium keystroke Alt-S = Send(“!s”) • Wait for particular windows to become active • Mouse. Click() to click a particular place on the screen 18
Automating Millennium tasks using Auto. It Warnings: • Not all Millennium commands can be done with keystrokes (use Mouse. Click) • Dependent on a certain window/application being active • Sometimes dependent on certain options already being selected or files being present 19
A simple Millennium automation: Create a list of recently cataloged titles • • • Choose Create Lists mode Select a list (review file) Search records button, Yes button Type review file name CAT DATE > (last Thursday) and < (today) Search button 20
Automating creation of list of recently cataloged titles • Auto. It code sample, demo http: //lib. lmu. edu/chennessey/iug 2006/Recently. Cataloge d. Titles. htm • To run, double-click on. AU 3 file, or run from batch file with: Auto. It 3 <script> <arg 1> <arg 2>, or make into an executable 21
Another Millennium automation: Send a list of records to a vendor • Choose Data Exchange mode • Choose Output MARC Records • Create <filename> out of a particular review file • Put FTS • Choose FTP site of vendor, log in • Transfer Files 22
Automating sending list of records to a vendor • Auto. It code sample, demo: http: //lib. lmu. edu/chennessey/iug 2006/Send. Records. htm • To run, double-click on. AU 3 file, or run from batch file with: Auto. It 3 <script> <arg 1> <arg 2>, or make into an executable 23
Another Millennium automation: Get & load a list of records from a vendor • • Choose Data Exchange mode Choose Load MARC Bib Records Get FTS Choose FTP site of vendor, log in Transfer Files Prep File Load File 24
Automating getting & loading list of records from a vendor • Auto. It code sample, demo: http: //lib. lmu. edu/chennessey/iug 2006/Load. Records. htm • To run, double-click on. AU 3 file, or run from batch file with: Auto. It 3 <script> <arg 1> <arg 2> 25
One more Millennium automation: Load Serials Solutions records • • Choose Data Exchange mode Choose Load MARC Bib Records Get FTS (or PC) Choose FTP site of vendor, log in Transfer each file Prep each file Load each file in different ways 26
Automating loading Serials Solutions records • Auto. It code sample, demo: http: //lib. lmu. edu/chennessey/iug 2006/Ser. Sol. Load. Recor ds. htm • To run, double-click on. AU 3 file, or run from batch file with: Auto. It 3 <script> <arg 1> <arg 2>, or make into an executable 27
More scripts • If you’d like to see more scripts, go to: http: //lib. lmu. edu/chennessey/iug 2006/win scripts. htm 28
Send(“!q”) [The End] Any questions? Contact information: Christina L. Hennessey chennessey@lmu. edu 310 -338 -5929 29
- Slides: 29