GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: tar cf -C
Operating System - HP-UX
1843962
Members
2011
Online
110226
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
06-14-2004 09:27 AM
06-14-2004 09:27 AM
Hi Everyone
I have to tar couple of files but the directory structure in my box is different from where the tar file is extracted.
I did write a script since there are numerous files whati did is
#!/usr/bin/sh
SCRIPTDIR=/home
HOME=$SCRIPTDIR/Patch
RIPFILE=$SCRIPTDIR/Patch/lists/rip_files.txt
FRSTFL=1
cd $SCRIPTDIR/
for FILE in `cat $RIPFILE`
do
if [ $FRSTFL = "1" ]
then /usr/local/bin/tar cf $HOME/TESTPATCH.tar $FILE -C $HOME?????????
FRSTFL=0
else /usr/local/bin/tar uf $HOME/TESTPATCH.tar $FILE
fi
done
The format in my box is /home/ABC/temp/123/...
i want to remove temp it should be like
ABC/123/...
Thanks
I have to tar couple of files but the directory structure in my box is different from where the tar file is extracted.
I did write a script since there are numerous files whati did is
#!/usr/bin/sh
SCRIPTDIR=/home
HOME=$SCRIPTDIR/Patch
RIPFILE=$SCRIPTDIR/Patch/lists/rip_files.txt
FRSTFL=1
cd $SCRIPTDIR/
for FILE in `cat $RIPFILE`
do
if [ $FRSTFL = "1" ]
then /usr/local/bin/tar cf $HOME/TESTPATCH.tar $FILE -C $HOME?????????
FRSTFL=0
else /usr/local/bin/tar uf $HOME/TESTPATCH.tar $FILE
fi
done
The format in my box is /home/ABC/temp/123/...
i want to remove temp it should be like
ABC/123/...
Thanks
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2004 10:17 AM
06-14-2004 10:17 AM
Re: tar cf -C
I tried my best to understand your question but guess it is not good enough :-)
Source: /home/ABC/temp/123
Destionation: /home/ABC/123
Is that what u r looking for ?
Try this
# tar -cvf 1.tar /home/ABC/temp/123/*
Destination
# pax -rf 1.tar -s '|temp||'
Source: /home/ABC/temp/123
Destionation: /home/ABC/123
Is that what u r looking for ?
Try this
# tar -cvf 1.tar /home/ABC/temp/123/*
Destination
# pax -rf 1.tar -s '|temp||'
Learn What to do ,How to do and more importantly When to do ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 01:28 AM
06-15-2004 01:28 AM
Re: tar cf -C
Thanks for Reply
Since there are to many files to tar i have to read them from a file.
Therefore the destination where it has to be untar that does not has temp folder the
directory structure is different.
home/abc/temp/123/...
home/ABC/123/...
there is no temp folder in the destination directory structure.
Thanks
Since there are to many files to tar i have to read them from a file.
Therefore the destination where it has to be untar that does not has temp folder the
directory structure is different.
home/abc/temp/123/...
home/ABC/123/...
there is no temp folder in the destination directory structure.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2004 03:31 AM
06-15-2004 03:31 AM
Solution
If you have that many files to tar, can you just tar the whole directory. That makes it a lot easier. On the source machine:
cd /home/abc/temp/123
tar cf TESTPATCH.tar .
On destination:
cd /home/abc/123
tar xf TESTPATCH.tar
You can also use xargs to make the tar file:
cd /home/abc/temp/123
cat $RIPFILE | xargs tar cf TESTPATCH.tar
cd /home/abc/temp/123
tar cf TESTPATCH.tar .
On destination:
cd /home/abc/123
tar xf TESTPATCH.tar
You can also use xargs to make the tar file:
cd /home/abc/temp/123
cat $RIPFILE | xargs tar cf TESTPATCH.tar
Email: michael.n.daulerio@lmco.com
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP