Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there anyway to make backup automatically? 1

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
I would like to make my backup server auto backup and switch tapes for me instead of I have to physically switch tape and issued the backup command everyday?<br><br>Here is some usefull info about the system:<br>- SunOS wrdbq1 5.6 Generic_105181-11 sun4u sparc SUNW,Ultra-2<br>-&nbsp;&nbsp;Adaptive Server Enterprise/11.5.1/P/Sun_svr4/OS 5.5.1/SWR 8304 Rollup/opt/Sat Feb&nbsp;&nbsp;6 14:05:47 PST 1999<br>- the harddrive is 8GB, and everyday I have to backup the 4GB database from HD to tapes by using command in Sybase, see below (this is for the first session of db):<br>1&gt; dump database oms to tapedump with init<br>2&gt;go<br><br>then when the first session of db is finished, I continue the next session with the following command:<br>1&gt; sp_volchanged 22, '/dev/rmt/0n', 'proceed'<br>2&gt; go<br><br>and so on until the last session of db is given, and the last tape kicks in.&nbsp;&nbsp;This takes me the whole day to do the backup, and if I am late for how many hour/minutes, I will have to stay late for that equal amount of time that I am late to finish the backup.!!! If it is automaticcally, then I don't have to worry about to be there to issue the backup command or switch tape.<br><br>According to someone told me, if I have a smaller database, I can perform auto backup , but the database is too big, which takes 3 DLT tapes to backup.&nbsp;&nbsp;Another person told me this can not be done unless to change the whole backup system to a better one, which has this kind of auto backup support for big database.&nbsp;&nbsp;I am not sure this is right, but I already able make one backup device auto backups with small db.<br>Thanks
 
# crontab -e<br><br>To schedule a nightly backup. Write a script to backup in Sybase and run a ufsdump of the OS. As far as automatically changing tapes, you will need a tape library (StorageTek makes pretty nice units) <p> <br><a href=mailto: > </a><br><a href= > </a><br>Yahoo Messenger: coily2
 
Hi coily2<br><br>I know the ufsdump command, which is to backup the filesystem and the filesystem must be inactive.&nbsp;&nbsp;However, I don't want to backup the filesystem, I want to backup the SYBASE database only.<br><br>And as I mention before, we have 2 db(s):&nbsp;&nbsp;1 is small, and 1 is big, which is the one I am talking about.&nbsp;&nbsp;The small db was usually at the same situation like the big one that I have to switch the tape and manual do the backup, but after that I write a script and it is auto backups now, but for the big db, I can not do that.<br><br>Thanks anyway
 
Is it a Sybase command that you are running to do the backup?&nbsp;&nbsp;If so, and if it's a shell script, you may be able to take a copy of the script and hack it around a little bit to get your tape switching command in there.<br><br>Something else you may be able to do is use the excellent <FONT FACE=monospace>expect</font> command.&nbsp;&nbsp;<FONT FACE=monospace>expect</font> lets you script interactive commands using a &quot;receive this&quot;, &quot;send that&quot; type format.&nbsp;&nbsp;It's much more powerful than that though, letting you do such things as conditional branching, etc.<br><br>If you want to use <FONT FACE=monospace>expect</font>, you will need to install <FONT FACE=monospace>tcl</font> as well.&nbsp;&nbsp;That's probably a little beyond the scope of this posting, but you can find more details at <A HREF=" TARGET="_new"> can find the <FONT FACE=monospace>expect</font> home page at <A HREF=" TARGET="_new"> this helps.
 
Thanks AndyBo<br><br>Yes, it is a SYBASE command to do the backup. I also hear about Expect script, but never try it before.&nbsp;&nbsp;I don't know if it really work, I'll try.<br>Thanks for the web sites that I am looking for too.<br><br>Thanks
 
To give you an idea of what <FONT FACE=monospace>expect</font> can do, a long time ago I had an ISDN router that needed some settings changing once or twice a week.&nbsp;&nbsp;Not a major task, but you had to go down about 6 menu levels and change 4 or 5 configuration settings.&nbsp;&nbsp;(Don't ask why - just let it be said that I now know there are a lot of easier ways of doing what we were doing :)<br><br>So, to cut out the grind of having to make the changes I set up a couple of <FONT FACE=monospace>expect</font> scripts to do the telnetting, menu travelling, and parameter changing.&nbsp;&nbsp;Then another script was set up to return things to their previous states.<br><br>I don't know if it's documented now, but at the time we used an undocumented <FONT FACE=monospace>expect</font> command line option to &quot;auto learn&quot; what had to be typed.&nbsp;&nbsp;(I think it's &quot;-a&quot;, or maybe &quot;-auto&quot;.)&nbsp;&nbsp;The way this works is that <FONT FACE=monospace>expect</font> starts up and then drops into the background.&nbsp;&nbsp;You take over control and type what you need to type.&nbsp;&nbsp;<FONT FACE=monospace>Expect</font> saves the screen output and your typing into a script that you can then execute again in the future.&nbsp;&nbsp;Very handy!<br><br>Anyway, sorry for waffling on a little :)&nbsp;&nbsp;I think expect will be able to do what you want, and I hope other folks have learned a little too :)<br><br>PS, there's even a Windows version these days...
 
Hi AndyBo<br><br>Thanks alot for your story, it really good help story.&nbsp;&nbsp;However, since you give me a alot of good info which I have very little knowledge about it.&nbsp;&nbsp;May I ask you 1) How can I install the Expect on my Unix box, and do I have to pay any attention about it?&nbsp;&nbsp;Since this is the production system (pretty scrary for me !), I don't dare to reboot or do such thing that people may jump on me and have &quot;a piece of me&quot;, ha ha ha, 2) If I want to install it on my Window system to gain control over my Sun box, can I do that too?<br><br>thanks a lot
 
OK, taking them 1 question at a time...<br><br>1) To install expect you would first need to install tcl.&nbsp;&nbsp;You can grab the sources from <A HREF=" TARGET="_new"> and compile them up on your server.&nbsp;&nbsp;There are full installation instructions supplied with tcl that will explain things a lot better than I can here :)<br><br>If you've not got a compiler, I think you will be able to grab a pre-compiled package installable with &quot;pkgadd&quot; from one of the many Sun freeware sites.&nbsp;&nbsp;(For example, <A HREF=" TARGET="_new"> either case, you won't need to restart the server.<br><br>Again from the <A HREF=" TARGET="_new"> or maybe <A HREF=" TARGET="_new"> grab the latest version of expect.&nbsp;&nbsp;Again, there are full instructions supplied with it that will explain installation a lot better than I could here.&nbsp;&nbsp;And again, you won't need to restart your server after it's installed.<br><br>2) I don't know if you'd be able to control things from your Windows machine using Expect for Windows.&nbsp;&nbsp;It's not something I've got any personal experience with, and I just mentioned it in passing as I'd seen a reference to it on the Expect home page.&nbsp;&nbsp;Taking a wild guess, though, I would think that you would be able to fire up a Windows telnet session and then send text to the telnet session. So, it may be possible.&nbsp;&nbsp;(Note that you'd need tcl/tk for Windows for Expect for Windows.&nbsp;&nbsp;Available from <A HREF=" TARGET="_new"> as an InstallShield exe.)<br><br>You'd need to give this a try to see if it worked for you.<br><br><br>Having said all that though, you would still want to take care while installing things onto your production server, and make sure that scripts you set up with Expect and going to do anything that's Real Bad...
 
Thank you very much AndyBo
 
It's a pleasure - how is everything working out?&nbsp;&nbsp;Did you get a solution in place yet? <p> <br><a href=mailto: > </a><br><a href= > </a><br>--<br>
0 1 - Just my two bits
 
Well, honestly with you, the backup is still doing manually !!!!!!!!, however, the Expect script is used for another purpose.&nbsp;&nbsp;It is in the state of monitoring, and they look good so far.<br><br>Thanks for asking.
 
Excellent - glad everything is going OK. :) <p> <br><a href=mailto: > </a><br><a href= > </a><br>--<br>
0 1 - Just my two bits
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top