Re: Database FTP?
Posted in 1995
In article <DGnMA8.1xC@nntpa.cb.att.com> jac@windmill.hr.att.com (Julio Cartaya) writes: >From: jac@windmill.hr.att.com (Julio Cartaya) >Subject: Database FTP? >Summary: Need to ftp an Informix Database >Keywords: ftp tbtape informix >Date: Wed, 18 Oct 1995 17:08:29 GMT >Hi, >I have two HP machines running Informix Online 5.0. To save recurring >shipping charges, I need to be able to ftp the contents of a DAT tape >created using "tbtape" on one machine, then reconstruct the tape on the >other machine, and use it to restore the database. >I tried using "dd" to do it, but it failed both with its native blocking, >and when I used the block sizes specified in the TBCONFIG file. >Has anyone done this? Has anyone done anything similar? I have also asked >Informix Tech Support, but they did not have any immediate answer. >Thanks in advance, >Julio A. Cartaya >jac@windmill.hr.att.com >(908)615-2689 Write a small c program which uses read() to read the tape into a huuuge buffer (bigger than you expect the block size to be). Read() will report the actual number of bytes read. Print this out. Loop for several blocks (you can actually throw the data away, all you want is the number of bytes read). If the number of bytes reported is the same as your buffer size maybe the real block size is larger so try again with a huuuuger buffer. This will give you the block size to pass to dd. One hint, rather than dd'ing your file to disk and ftp'ing to disk and putting it on tape again you could try dd'ing to standard out piped to remote shell invoking a dd using standard input and writing to DAT on your remote system: Local Remote DAT > dd |remsh --->dd > DAT Ian