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!

help creating script to dd data from 3490 mag tape

Status
Not open for further replies.

Natalie

Programmer
Jun 6, 2000
29
US
Hello,

I'm very new to UNIX and have inherited the task of importing monthly data from a 3490 magnetic cartridge to an AIX 4.3.3 server.

There are 4 files on each cartridge. The trick is that each file has a different block size. (I have contacted the client and they say that that's the only way they can send it.) I'd like to create a script that I can run that will rewind the tape, import one file, then the next, then the next, etc., then rewind the tape - without my having to sit there and wait for each file to import. If it could FTP the files to another machine and send me an email when it's finished, that would be great, too!

Also, the month would be the previous month from when the script is running. For example, we get July's data in August, so it will be run in August, but the filename will be July1.txt, July2.txt, etc.

Once the files are imported, I would like to move them to another directory on an NT network. Presently, I ftp them using the 'get' command from the NT server. Is there a way to do this all in the same script??

Here are the commands I currently use (in order):
tctl -f/dev/rmt5 rewind
dd if=/dev/rmt5.1 of=month1.txt bs=8000 conv=ascii fskip=0&
dd if=/dev/rmt5.1 of=month2.txt bs=8440 conv=ascii fskip=0&
dd if=/dev/rmt5.1 of=month3.txt bs=8000 conv=ascii fskip=0&
dd if=/dev/rmt5.1 of=month4.txt bs=9660 conv=ascii fskip=0&
tctl -f/dev/rmt5 rewind

Is there a way to create a script to combine these commands?

Thanks!

Natalie
 
yes natalie, i do not know AIX, but sure your tctl command is able to positioning on the
beginn of next file, you only have to use a NON rewinding device.
YOU cannot run this commads in background !!! they are all working on the same tape.
on solaris i say:

mt -f /dev/rmt/0 rewind
for aa in 0 1 2 3
do
mt -f /dev/rmt/0n fsf $aa # positioning the tape
dd if=/dev/rmt/0n .... .... # this is the NON rewinding tape
done

alternatively you could use tar|cpio|ufsrestore
 
Just cut and paste the commands you put in above into a file. Remove the "&"'s.

That's a script in its most basic form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top