- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- use tar but exclude certain files ?
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
01-18-2006 08:10 AM
01-18-2006 08:10 AM
=========
How do I tar up all files in /home/app except
the ones in the excludefile (see wildcard entry below)
# cat excludefile
/home/app/data/*/archive
/home/app/data/*/inbound/retrieve
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 08:21 AM
01-18-2006 08:21 AM
Re: use tar but exclude certain files ?
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 08:22 AM
01-18-2006 08:22 AM
Re: use tar but exclude certain files ?
tar cvf /destination/file `cat filelist.txt`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 08:30 AM
01-18-2006 08:30 AM
Re: use tar but exclude certain files ?
tar cvf /destination/file `find /home/app/data -type f -exec ls {} \; | grep -E -v "archive|retrieve"`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 08:32 AM
01-18-2006 08:32 AM
Re: use tar but exclude certain files ?
find /home/app/data -print | grep -v -f excludefile | pax -w -f savehere.tar
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 08:34 AM
01-18-2006 08:34 AM
Re: use tar but exclude certain files ?
Best option is to go for fbackup .
thx,
bl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 08:45 AM
01-18-2006 08:45 AM
Re: use tar but exclude certain files ?
I have too many directory to include files as I am tarring up the entire f/s.
I like your second method, but only drawback
is it will exclude archive directory in /home/app/archive as well. I think.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 09:06 AM
01-18-2006 09:06 AM
Re: use tar but exclude certain files ?
The pax worked but it did not exclude files in my excludefile list. see below please.
Thanks
# pwd
/home/app
find . -print | grep -v -f excludefile | pax -w -f savehere.tar
# cat excludefile
./data/007916208/archive
./data/007941446/archive
./data/0079414460018/archive
fbackup may be only option although I am playing around with Ivan solution to see i can manually copy certain 2 or 3 archive directory that are not under /home/app/data but uder /home/app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 09:25 AM
01-18-2006 09:25 AM
SolutionAlso, I found I left off a key option to "pax". Add the "d" option to prevent it from walking directories.
So the correct line should be-
find /home/app/data -print | grep -v -f excludefile | pax -wd -f savehere.tar
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2006 09:37 AM
01-18-2006 09:37 AM
Re: use tar but exclude certain files ?
To use "excludefile" as a grep pattern matcher, then each "*" must be preceded by a ".".
example-
/home/app/data/.*/archive
Because the "*" wildcard was looking for zero or more "/".
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2006 01:09 AM
01-19-2006 01:09 AM
Re: use tar but exclude certain files ?
I tried .* in the excludefile and just executed find .Apparently find does not
recognize wildcard in this case and thus include everything in my excludefile list. But, your suggestion
works great if I expand the directory names and not use *. It then gives me a tarball excluding archive and retrieve
(that is what i want). That's good enough for me
# cat excludefile
/home/app/data/.*/archive
/home/app/data/.*/inbound/retrieve
But, your suggestion
works great if I expand the directory names and not use *. It then gives me a tarball excluding archive and retrieve
(that is what i want). That's good enough for me. I guesss that is as good as it gets. Thansk a bunch for your help as
your solution got me what I wanted (using a workaround)
# cat excludefile
/home/app/data/costco/archive
/home/app/data/samclub/archive
/home/app/data/walmart/archive
/home/app/data/sears/inbound/retrieve
/home/app/data/bbuy/inbound/retrieve
Ivan,
Thanks to Ivan as well since his solution would work fine if I did not have any other archive directory.