Operating System - HP-UX
1758575 Members
2223 Online
108872 Solutions
New Discussion юеВ

copying files from a directory ending in Z

 
SOLVED
Go to solution
James Ellis_1
Super Advisor

copying files from a directory ending in Z

I want to copy to tape files under the following directories:

/work/work *.ttl
/SQL/CTL *.ctl

All the files that have the ending .ttl and .ctl are to be copied.

Will the *.ctl files overwrite the .ttl files?

Also, is it possible to compute the total space all of these files will consume?

Thanks.
"In the middle of difficulty lies opportunity" -Einstein
14 REPLIES 14
Patrick Wallek
Honored Contributor

Re: copying files from a directory ending in Z

Ummm.......No. Are you copying the files from different directories (/work and /SQL) into the same directory (/dest)?

You are doing something like:

# cp /work/work*.ttl /dest
# cp /SQL/CTL*.ctl /dest

No worries. The files have different extensions (.ttl and .ctl) so they have different names. Only if the file names were EXACTLY the same would you have any worries.
Helen French
Honored Contributor

Re: copying files from a directory ending in Z

Which command are you intend to use for copying these files to a tape? If you donot rewind the tape (use no-rewind device file) and you donot eject the tape, you can append these files. OR if you are using specific backup tools such as Omniback, Netbackup or Legato, you can easily do this by appending it to the same tape.

Btw, *ttl will not overwrite *ctl.
Life is a promise, fulfill it!
Patrick Wallek
Honored Contributor
Solution

Re: copying files from a directory ending in Z

Please ignore my first post. I just read copy, I didn't see the copy to tape part.

You must make sure you use the correct 'tar' syntax (or whatever command you use).

If you do:

# cd /
# tar -cvf /dev/rmt/0mn work/work*.ttl SQL/CTL*.ctl

I show the 'cd /' so that you can use relative paths instead of explicit paths in the tar command. This makes for much easier restores down the road.

The space the files will consume on the tape is hard to know. If the tape drive does compression by default then the total size of the files on the disk may be much greater than the size of the files on the tape once they are compressed.
Leif Halvarsson_2
Honored Contributor

Re: copying files from a directory ending in Z

Hi,
Or, using cpio.

find . -name '*.ttl' -o -name '*.ttl' |cpio -o >/dev/rmt/0m
James Ellis_1
Super Advisor

Re: copying files from a directory ending in Z

When I tried to run the tar command, I got a message saying

cannot open /dev/rmt/0m and
cannot open /dev/rmt/0mn

This is a tape that has worked before when making make_recovery tapes. ioscan shows I am using the correct path name. Any ideas what is going on?

Thanks.
"In the middle of difficulty lies opportunity" -Einstein
Robert-Jan Goossens
Honored Contributor

Re: copying files from a directory ending in Z

James maybe a very stupid question, but do you have inserted a tape ?
Paula J Frazer-Campbell
Honored Contributor

Re: copying files from a directory ending in Z

HI

cannot open /dev/rmt/0m and
cannot open /dev/rmt/0mn


Chech that 0m is the correct tape device file.

ll /dev/rmt


Paula
If you can spell SysAdmin then you is one - anon
Mark Grant
Honored Contributor

Re: copying files from a directory ending in Z

Also, perhaps if it was an Ignite tape once, you might have set the "read only" tab

However, "ioscan -fnC tape" will confirm which devices have a tape drive attached.
Never preceed any demonstration with anything more predictive than "watch this"
James Ellis_1
Super Advisor

Re: copying files from a directory ending in Z

I got a tape in, I reminded myself to check that when this problem came up.

The ioscan -fnC tape shows

tape 0/0/1/0.3.0 for /dev/rmt/0m

And when doing ll /dev/rmt the output shows

0X003000 0m

So this all looks right. One thing is, this tape was used to make a make_recovery tape and my guess is this should not be a problem. I am not sure what the problem is, checked all of the cables and it looks alright to me.

thanks
"In the middle of difficulty lies opportunity" -Einstein