Operating System - HP-UX
1833016 Members
2242 Online
110048 Solutions
New Discussion

Re: tar backup - need ur help

 
SOLVED
Go to solution
Shrikant Lavhate
Esteemed Contributor

tar backup - need ur help

Hi all,

I need to take tar backup of vg00 only. Command in my mind is :
tar cvm -C / -C /stand -C /var -C /var/spool/lp -C /var/adm/sw -C /var/adm/crash -C /usr -C /tmp -C /opt -C /home

But problem looks here is when I say -C / it will include whole directory structure including application directories. Is there any way to have selective directory selection like graph file in ignite??? Heard about GNU tar too. I hope its not there on server.

I want strictly into tar. Not interested in cpio, ignite.



Will it remain a personal, if I broadcast it here!
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: tar backup - need ur help

You need to toss tar and use pax(1). That allows you to read stdin and use find -xdev.
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1182133$

find / /stand /var /var/spool/lp /var/adm/sw /var/adm/crash /usr \
/tmp /opt /home -xdev | pax -w -v -f /dev/rmt/0m

Hmm. That "/" may still get too much. You may have to use -d in pax so it only does the listed directories and files.

Note /var will get the other two /var/X if on same filesystem. You of course can put an exclude filter in the pipe.
Steven Schweda
Honored Contributor
Solution

Re: tar backup - need ur help

Unless you intend to make one big mess, I
don't think that "-C" does what you think it
does.

> Heard about GNU tar too. I hope its not
> there on server.

You hope it's _not_ there? Why? If nothing
else, the documentation is fun to read, and
educational:

http://www.gnu.org/software/tar/manual/
http://www.gnu.org/software/tar/manual/tar.html

If you can use "find" (or something) to
produce a complete list of names to add to
the archive, then "--files-from=file-name"
("-T file-name") with "--no-recursion" could
be useful. Also, "--one-file-system" could
be handy.
Shrikant Lavhate
Esteemed Contributor

Re: tar backup - need ur help

Thanks you both.

Will go with -T option
Will it remain a personal, if I broadcast it here!