[ List Archives Home ] [ Thread index for 2008 ]
[ Date index for 2008 ]
[ Author index for 2008 ]
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
- Date: Fri, 02 Nov 2001 18:09:16 -0500 (EST)
- From: Tony Dominick <dominica@xxxxxxxxxx>
- Subject: Re: [Fwd: Re: Automating Backup Verifies]
Hello to all in Innopac-land,
I heard that some were interested in my method for automating the step
that verifies the backups. First a little background so you know where
I'm coming from. Here at Drexel University we don't have a tape drive
attached to our Innopac server so we had Innovative make our back routine
place the backup file on the server's hard drive. This in turn gets backed
up by the university's central backup server. We have scheduled
unattended full backups to take place each night at 12:00 midnight. Now
with this setup and running everything was automated except the "Verify
the backup" part.
To automate the the "Verify the backup" part I used a unix-like system,
the "crontab" task scheduler (that comes with most unix-like systems), and
the scripting language Expect. They are all freely available from the
internet so the price was right for me. Now I just look at the
"Unattended backup log" once a week to make sure everything is okay. So
far a year has gone by with only one problem that Innovative was nice
enough to correct.
You can get info and download the Expect scripting language from
<http://expect.nist.gov/>. Looking at this website I see that they have
Windows version of Expect available. I've never used it so someone let
me know well it works. I can recommend the book "Exploring Expect" by Don
Libes which helped me.
Below is the Expect script that I wrote.
Linda and Chris, sorry to keep you waiting, I have been a little busy.
HTH,
Tony
>--------------------------<
Tony Dominick
W.W. Hagerty Library
Drexel University
Philadelphia, PA 19104
215.895.1832
dominica@xxxxxxxxxx
>--------------------------<
===============================================================
#!/usr/local/bin/expect --
# This script will verify the backups on the INNOPAC server each
# day.
# Tony, 5-Feb-2001
# Set some common variables for the script to use repeatedly,
set un "login_username" ;# INNOPAC login
set pw "login_password" ;# INNOPAC pw
set initials "my_initials" ;# Tony's initials
set ipwd "my_initials_password" ;# Tony's pw
set eaddress "dominica@xxxxxxxxxx" ;# Tony's e-mail address
# set a general timeout for each command to complete
set timeout 10
# Start the error checking
#exp_internal 1
# Stop the error checking
#exp_internal 0
# Start the SSH session, 5 possible responses:
# Option 1 - No SSH connection available
# Option 2 - Unknown host
# Option 3 - Not a familiar host
# Option 4 - Bad username
# Option 5 - Good connection
# NOTE, use your server's name instead of "innopac.server.edu"
spawn ssh -l $un innopac.server.edu
expect {
"Secure connection to * refused" exit
"no address associated with name" exit
"The authenticity of host*can't be established*Are you sure you want to
continue connecting" exit
"Permission denied" exit
"password: "
}
# Good username, now what about the pw?
# Option 1 - bad pw
# Option 2 - good username
send "$pw\r"
expect "Permission denied, please try again" {
send "\r\r"
exit
} "S,D,C,O,M,A,X" {
# Keep on going
}
###################
# Navigate the menu
###################
send "a"
expect "B,S,M,D,R,I,E,V,F,L,K,N,U,A,Q"
send "b"
expect "your initials "
send "$initials\r"
expect "your password "
send "$ipwd\r"
# need to account for changed passwords ###############################
# mail me if incorrect
###################
# Verify the backup
###################
expect "D,F,C,E,V,U,T,Q"
send "v"
expect "D,F,Q"
send "f"
# Allow for long verification time, currently 20 minutes is allowed
# and the verifying process takes 5 minutes as of 6.18.01
set timeout 1200
expect "Press <SPACE> to continue"
send " "
# Reset the default timeout
set timeout 10
expect "Press <SPACE> to continue"
send " "
expect "Choose one (D,F,Q"
send "q"
expect "Choose one (D,F,*E,V,U,T,Q"
send "q"
##########################
# Now exit out of the menu
##########################
expect "Choose one (B,S,M,D,R,I,E,V,F,L,K,N,U,A,Q)"
send "q"
expect "Choose one (S,D,C,O,M,A,X)"
send "x"
# Wait for the connection to end
expect "Connection to * closed"
wait -nowait
exit 0
===============================================================