- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to tar some directories
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
02-03-2006 07:58 AM
02-03-2006 07:58 AM
how can i do it?
#cd /praveen/data
#ll
total 0
drwxr-xr-x 2 root root 96 Jan 21 13:17 lost+found
drwxrwx--x 4 praveen dba 96 Jan 3 01:10 share.orig
I need to take the backup using tar of share.orig directoy and place into /praveen/backup
can anybody suggest me the tar command with full options?
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2006 08:03 AM
02-03-2006 08:03 AM
Solution# cd /praveen/data
# tar -cvf /praveen/backup/share.orig.tar ./share.orig
The above will create a tar file called share.orig.tar in /praveen/backup. That tar file will contail the share.orig directory in /praveen/data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2006 08:27 AM
02-03-2006 08:27 AM
Re: how to tar some directories
but can you please tell me how to test and extract it in other directory "/praveen/newbackup"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2006 08:36 AM
02-03-2006 08:36 AM
Re: how to tar some directories
# tar -xvf ./share.orig.tar
Will extract a tar archive. Now this assumes that the archive was created with relative paths, the ./share.orig that I gave in my example. If it was created with explicit paths , /praveen/data/share.orig, then you are out of luck as the archive will be extracted back to the same place.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2006 08:44 AM
02-03-2006 08:44 AM
Re: how to tar some directories
Since the archive was created with relative paths and not absolute ones, you can simply 'cd' into a directory to which you want to restore and do:
# tar -xvf archivename
Had the archive been created with absolute paths for its files, you could have used 'pax' to substitute (or strip) the parts of the path you didn't want.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2006 07:08 PM
02-03-2006 07:08 PM
Re: how to tar some directories
#tar -cvf /praveen/backup/share.orig.tar ./share.orig
with this command you can create a backup of share.orig to /praveen/backup/share.orig.tar file
# tar -xvf ./share.orig.tar
with this command you can extract share.orig.tar file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2006 12:28 AM
02-05-2006 12:28 AM
Re: how to tar some directories
Its dependent on when you create a tar file for example if you are creating a tar for PRAVEEN dir which resides in
/root/home/PRAVEEN
sp if you issue this command to create tar
#tar -cvf PRAVEEN.tar /root/home/PRAVEEN
now if you untar it. It will always be untar in /root/home/PRAVEEN
but if you do like this
#cd /root/home
#tar -cvf PRAVEEN.tar PRAVEEN
Now if you untar this file it will untar in the current directory on the system whereever you are.
HTH,
Shivam Tiwari