- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How can I get tar to exclude mount points
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:16 AM
11-03-2000 05:16 AM
Backup /home/sybase (But want to exclude /home/sybase/dumps).
the -T option doesnt work to read from a list and I tried a find piped to tar but it complained that the file list was too long
Any ideas on where to go now.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:28 AM
11-03-2000 05:28 AM
Re: How can I get tar to exclude mount points
If you want to avoid the "argument list too long"
message, use xargs as in the following command:
find /home/sybase -xdev | xargs tar cvf /dev/rmt/0m (or any other device)
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:34 AM
11-03-2000 05:34 AM
Re: How can I get tar to exclude mount points
find /home/sybase | grep -v /home/sybase/dump | pax -wf /dev/rmt/0m
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:38 AM
11-03-2000 05:38 AM
Re: How can I get tar to exclude mount points
Use pax
Pax writes tar achives file format by default and X (uppercase) flag.
Files writed with pax can be read with tar.
See man pax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:42 AM
11-03-2000 05:42 AM
Re: How can I get tar to exclude mount points
You dont need to use find with pax.
Use pax -w -f /dev/rmt/.... /filesystem or directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:43 AM
11-03-2000 05:43 AM
Re: How can I get tar to exclude mount points
As said at the bottom of the pax manpage,
its current implementation is based on a
Posix 2 draft and HP recommends using the
current version only if absolutely
necessary.
I wouldn't save any important stuff without
being sure to be able to re-read it later.
:-((
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:46 AM
11-03-2000 05:46 AM
Re: How can I get tar to exclude mount points
I will post results shortly (and probly try pax anyway - am looking at the man page right now)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 05:50 AM
11-03-2000 05:50 AM
Re: How can I get tar to exclude mount points
find /home/sybase -xdev | xargs tar -cvf /home/sybase/dumps/jdr.tar
but it still put the /home/sybase/dumps files in the tar.
and yes they are diff mount points
/dev/vg0101/lvsybase1
698133 500060 128259 80% /home/sybase
/dev/vg0101/lvsybdump1
1502713 421077 931364 31% /home/sybase/dumps
the find with -xdev works I know, but havent used xargs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 06:02 AM
11-03-2000 06:02 AM
Re: How can I get tar to exclude mount points
As the -xdev option of find visits the mount
point without visinting the entries below it,
your xargs tar command receives the /home/sybase/dumps as input.
Adding flag -type f will do the job.
Your command should now look like:
find /home/sybase -type f -xdev | xargs ....
I should have tested the command before posting ;-)
Hope this helps
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 06:10 AM
11-03-2000 06:10 AM
Re: How can I get tar to exclude mount points
An alternative approach would be to use 'fbackup' with a graph that includes and excludes the directories you require. See the man pages (1M) for fbackup/frestore. This forum contains a great deal of good discussion regarding fbackup if you are unfamilar with it, too.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 06:11 AM
11-03-2000 06:11 AM
Re: How can I get tar to exclude mount points
you would want to use the find however, if there are other mount points below /home/sybase that you would like to include, -xdev would not help you. Also, if /home/sybase/dump is not a file system, it would not help you. You could try a combination of find and grep -v as follows:
find /home/sybase -print | grep -v "/home/sybase/dump/*" | xargs ....
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 06:35 AM
11-03-2000 06:35 AM
Re: How can I get tar to exclude mount points
find /home/sybase -xdev -exec tar -cvf /home/sybase/dumps/out.tar {} ;
maybe maybe.. what do you think
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 06:51 AM
11-03-2000 06:51 AM
Re: How can I get tar to exclude mount points
I don't understand why your tar file doesn't
include all the files.
Does the command find /xxx -type f -xdev
show all needed files?
Do you have the right permissions to read
all the files?
Dan
PS: adding the -exec tar won't help because
the mountpoint is still visited.
As soon as tar receives a directory as
argument, all files below it are archived.
That's why I added th e-type f option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 07:06 AM
11-03-2000 07:06 AM
Re: How can I get tar to exclude mount points
find /home/sybase print |grep -"/home/sybase/dumps" | xargs tar -cvf /home/sybase/dumps/sybdump.tar
The find command on its own (find /home/sybase print |grep -"/home/sybase/dumps" ) works fine - however the tar was creating files in that dir when I used the -xdev on the find.
Will update in a few when job finishes and I thank all of you for you help..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 07:17 AM
11-03-2000 07:17 AM
Re: How can I get tar to exclude mount points
when i run: find /home/sybase print |grep -v "/home/sybase/dumps" | grep dum i dont get /home/sybase/dumps but when I change teh grep dum to xargs tar cvf /home/sybase/dumps/sybas.tar it wants to tar the /home/sybase/dumps filesystem.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 07:22 AM
11-03-2000 07:22 AM
Re: How can I get tar to exclude mount points
cd dir
find . -xdev -print | cpio -ovcdumB > /dev/rmt/??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 07:30 AM
11-03-2000 07:30 AM
Re: How can I get tar to exclude mount points
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 08:08 AM
11-03-2000 08:08 AM
Re: How can I get tar to exclude mount points
without crossing the mount point:
find /home/sybase -type f -xdev | cpio -pdvum
v is optional, as it gives verbose info on the files copied.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 08:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 08:34 AM
11-03-2000 08:34 AM
Re: How can I get tar to exclude mount points
You can download a precompiled binary in SD depot format from a HP-UX Porting and Archive Center mirror in your neighborhood (like http://hpux.cae.wisc.edu ). The documentation for GNU tar is very thorough, though you will need to install the 'texinfo' depot as well, as it is in 'texinfo' format. (A terse 'man' page is included as well, for quick reference.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2000 10:41 AM
11-03-2000 10:41 AM
Re: How can I get tar to exclude mount points
Fbackup/frestore is another option, of course, but that would exclude any possibility of restoring the backup sets on some other (non-HP-UX) platform. Which may not even be a concern at your site...