- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to Tell tar to not to copy few dir's
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
- 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
03-13-2003 10:07 AM
03-13-2003 10:07 AM
How to Tell tar to not to copy few dir's
/APPDIR
under this dir there are many sub dir's and files goes down to 3 or 4 levels of dirs and files. Some of log dirs are LOGDIR ERRLOG TRLOG SCANLOG.
I don't want these dirs and files in them. How can I do this using tar.
I tried cpio and it works fine.
find /APPDIR -name "*" -print > temp1
egrep -v "/APPDIR/LOGDIR|/APPDIR/ERRLOG|/APPDIR/TRLOG|/APPDIR/SCANLOG" temp1 > cpio.lst
cat cpio.lst | cpio -ocBv > bakup.022103.cpio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 10:13 AM
03-13-2003 10:13 AM
Re: How to Tell tar to not to copy few dir's
tar cvf /dev/rmt/0m `cat cpio.lst`
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 11:30 AM
03-13-2003 11:30 AM
Re: How to Tell tar to not to copy few dir's
Instead of plain old tar for this backup, you should use fbackup.
You can include (-i) whatever paths you wish or exclude (-e) paths.
Or you could define a graph file to include OR exclude whatever you wish & just reference it.
Has the extra added benefit that it can handle +2Gb files whereas tar cannot.
See man fbackup for further details.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2003 11:50 AM
03-13-2003 11:50 AM
Re: How to Tell tar to not to copy few dir's
for FILE in `find . -type d|grep -v DIR1|grep -v DIR2`
do
tar cvfr /tarfile $FILE
done
Shell scripting from the prompt is an art form and bloodsport.....
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2003 05:42 AM
03-14-2003 05:42 AM
Re: How to Tell tar to not to copy few dir's
pax is a mix and match of cpio and tar. For example for your case, you can tell it to write in tar *format*, but still take the list of filenames from *standard input*, i.e. like cpio.
A simple *demonstration*:
find . | pax -w -d | tar tvf - 2>&1 | more
I.e. this shows that pax can read the filenames from standard input and writes in tar format (otherwise the "tar tvf -" would fail).
Note that "-d" is needed in order to archive directories, *not* their content.