- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Another tar question
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
Forums
Discussions
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
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
01-09-2002 09:15 AM
01-09-2002 09:15 AM
I need to make a tar backup and exclude a number of files. I know the X option will do this but is not working properly for me.
Could some helpful soul let me know the best syntax for excluding files from a tar backup?
THanks,
Kel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:26 AM
01-09-2002 09:26 AM
Re: Another tar question
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:29 AM
01-09-2002 09:29 AM
Re: Another tar question
Are you sure about that -X option for tar? I am sure that exists. If you have to use tar you may need to pipe it through find.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:32 AM
01-09-2002 09:32 AM
Re: Another tar question
X Exclude. Use the exclude-file argument as a file containing a list of relative path names for files (or directories) to be excluded from the tarfile when using the functions c, x, or t. Be careful of trailing white spaces. Also beware of leading white spaces,since, for each line in the excluded file, the entire line (apart from the newline) will be used to match against the initial string of files to exclude. Multiple X arguments may be used, with one exclude-file per argument. In the case where included files (see -I include-file option) are also specified, the excluded files take precedence over all included files. If a file is specified in both the exclude-file and the include-file (or on the command line), it will be excluded.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:34 AM
01-09-2002 09:34 AM
Re: Another tar question
$ cd dirA
$ ls|grep -v aug|xargs tar cvf /dev/rmt/0m
The above will exclude filename with "aug" string in it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:34 AM
01-09-2002 09:34 AM
Re: Another tar question
I think that the best way is using a find in order to obtain an intermediate file and then in this file exclude the path's that you don't want to backup, and us it as input for tar.
I don't find -X option in man tar too.
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:35 AM
01-09-2002 09:35 AM
SolutionI'm not so sure, but i believe tat does not support good file selection for backup. You should try fbackup with the graph option. Here are a few link from hp docs site on the tar / fbackup usage and the backup utilities available
tar
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90680/B2355-90680_top.html&con=/hpux/onlinedocs/B2355-90680/00/03/338-con.html&toc=/hpux/onlinedocs/B2355-90680/00/03/338-toc.html&searchterms=tar&queryid=20020109-093701
fbackup
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90681/B2355-90681_top.html&con=/hpux/onlinedocs/B2355-90681/00/00/78-con.html&toc=/hpux/onlinedocs/B2355-90681/00/00/78-toc.html&searchterms=fbackup&queryid=20020109-094036
backup utilities
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90742/B2355-90742_top.html&con=/hpux/onlinedocs/B2355-90742/00/00/51-con.html&toc=/hpux/onlinedocs/B2355-90742/00/00/51-toc.html&searchterms=tar%20fbackup&queryid=20020109-093423
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:36 AM
01-09-2002 09:36 AM
Re: Another tar question
Barring that, you might want to try a hint I got here a couple of weeks ago. Assuming that you want to create "destfile" and the text file with the filenames in it is "filelist" the command:
tar cvf destfile `cat filelist`
works pretty well also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:44 AM
01-09-2002 09:44 AM
Re: Another tar question
What would be the best HP-UX way to exclude files from a tar backup?
Syntax would be great.
Thanks,
Kel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 09:49 AM
01-09-2002 09:49 AM
Re: Another tar question
tar -cvf tarfile `find . -print | egrep -vx 'file1|file2|..|fileX'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2002 10:50 AM
01-09-2002 10:50 AM
Re: Another tar question
You can get GNU's tar, which will do as you ask:
http://hpux.connect.org.uk/hppd/hpux/Gnu/tar-1.13.25/
and documentation from GNU:
http://www.gnu.org/manual/tar/html_mono/tar.html#SEC39
live free or die
harry