- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: The tar utility
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
Discussions
Discussions
Forums
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
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
тАО07-08-2010 01:18 AM
тАО07-08-2010 01:18 AM
These days i'm doing cold backup of my database and i need free space for 2 weeks. There are a lot files and have uses big size. Can i archive them? I looked for and found that tar can help me. I read this article about tar utility - http://docs.hp.com/en/B2355-60105/tar.1.html
should i do like these for archiving file1, file2 etc?
$tar cvf /tmp/my_directory file1 file2 fileN?
and how can i rearchive them?
Best regards,
Rustam,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2010 01:44 AM
тАО07-08-2010 01:44 AM
Re: The tar utility
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=102710
WARNINGS
Because of industry standards and interoperability goals, tar does not
support the archival of files larger than 8GB or files that have user/group IDs greater than 2048k. Files with user/group IDs greater than 2048k are archived and restored under the user/group ID of the
current process, unless the uname/gname exists (see tar(4)).
1.- Firs day
# tar cvf file.tar file1 file2
2.- Second day
# tar uvf file.tar file1
# tar tvf file.tar
rw------- 0/3 16 Jul 8 11:24 2010 ./file1.txt
rw------- 0/3 14 Jul 8 11:24 2010 ./file2.txt
rw------- 0/3 32 Jul 8 11:24 2010 ./file1.txt
3.- recover file
tar xvf file.tar ./file2.txt
rgs,
rgs,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2010 02:17 AM
тАО07-08-2010 02:17 AM
Re: The tar utility
For Eg: you wish to back /data
# tar -cvf data-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2010 04:03 AM
тАО07-08-2010 04:03 AM
Re: The tar utility
If you are concerned about files larger than 8GB, you will need to use 'pax' [with the '-x pax' format specification; use 'fbackup'/'frecover'; or use another product like Data Protector.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2010 09:18 PM
тАО07-08-2010 09:18 PM
Re: The tar utility
1. my file size was:
... 5396217435 Jun 29 20:51 exp_full.dmp
i run
$ tar cvf file_test.tar exp_full.dmp
and it became
... 5396224000 Jul 9 10:03 file_test.tar
why? file created but size more than source file?
2. # tar uvf file.tar file1 - is this command added in tar file new file1 for being archived?
3. #tar xvf file.tar ./file2.txt - this command extracts file file2.txt from archive set file.tar?
4. and this one shows all file in tar set - # tar tvf file.tar ?
5. # tar -cvf data-
6. ...JRF...-- my files havent larger than 8GB, yet. But think in few months they will. Could you give me a list of example of using pax?
Best regards,
Rustam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2010 12:01 AM
тАО07-09-2010 12:01 AM
SolutionAnswers are inline.
1. my file size was:
... 5396217435 Jun 29 20:51 exp_full.dmp
i run
$ tar cvf file_test.tar exp_full.dmp
and it became
... 5396224000 Jul 9 10:03 file_test.tar
why? file created but size more than source file?
ANS: The tar command writes data in blocks of 512 bytes in length. Hence the file length is rounded up to multiple of 512 byte and extra zeros are added to fill the length. Thus you see the tar package size more than the source file.
If you want to compress the tar package, then use gzip command.
For e.g. the following cmd creates file_test.tar.gz much compressed than original source file.
gzip file_test.tar # To compress
gunzip file_test.tar.gz # To uncompress
2. # tar uvf file.tar file1 - is this command added in tar file new file1 for being archived?
ANS: Yes. Following is the snippet from man tar
u option Add any named file to the archive if it is not already present or has been modified since it was last written in the archive. The same blocking factor used to create the archive must be used to update it.
3. #tar xvf file.tar ./file2.txt - this command extracts file file2.txt from archive set file.tar?
ANS: In a way correct. But you need to specify the whole path used while creating tar package.
For e.g: To extract file a from TEST.tar
# tar -tvf TEST.tar
rwxrwxrwx 0/3 0 Jul 9 13:28 2010 TEST/
rw-rw-rw- 0/3 0 Jul 9 13:28 2010 TEST/a
rw-rw-rw- 0/3 0 Jul 9 13:28 2010 TEST/b
rw-rw-rw- 0/3 0 Jul 9 13:28 2010 TEST/c
rw-rw-rw- 0/3 0 Jul 9 13:28 2010 TEST/d
rw-rw-rw- 0/3 0 Jul 9 13:28 2010 TEST/e
# tar -xvf TEST.tar TEST/a
4. and this one shows all file in tar set - # tar tvf file.tar ?
ANS: YES. you are right.
HTH
Muru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2010 12:12 AM
тАО07-09-2010 12:12 AM
Re: The tar utility
1. my file size was:
... 5396217435 Jun 29 20:51 exp_full.dmp
i run
$ tar cvf file_test.tar exp_full.dmp
and it became
... 5396224000 Jul 9 10:03 file_test.tar
why? file created but size more than source file?
That tar - tar stores more information than just the file, so it's a bit greater. You can see this information like an envelope.
BTW. You want MORE space? Then you should use a compress programm like 'compress' or gzip! Tar doesn't compress it only 'archive' data files. The only way to compress with tar is to write it to a tape, where the tape does the compression.
2. # tar uvf file.tar file1 - is this command added in tar file new file1 for being archived?
Yes - see also the manual pages of tar:
'man tar' (or the document you mentioned)
3. #tar xvf file.tar ./file2.txt - this command extracts file file2.txt from archive set file.tar?
like 2.
4. and this one shows all file in tar set - # tar tvf file.tar ?
Yes
As mentioned above, with tar you'll create an additional file, so you don't create free space, but double the space a file needs.
With a tarred archive you can compress it simplier with 'gzip', but then you can't add another file to the archive.
Else you want to write it with tar to a tape ....
HTH
V.
BTW. what's your os?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2010 01:34 AM
тАО07-09-2010 01:34 AM
Re: The tar utility
It's pretty simple it has the best of cpio and tar options:
pax -v -w -f /tmp/my_directory.pax file1 directory2 ...
And -r to read and nothing to list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2010 03:24 AM
тАО07-09-2010 03:24 AM
Re: The tar utility
Except these commands:
# tar -cvf data-
I don├в t know why, maybe I got misunderstand of syntax├в ┬ж
And this one,
>It's pretty simple it has the best of cpio and tar options:
>pax -v -w -f /tmp/my_directory.pax file1 directory2 ...
Denis, I didn├в t run your command coz my files don├в t have size more than 8Gb. Hope in few weeks it will be useful for me and I can use it.
Thank you, Muru and V,
My OS is HP-UX and version is 11.3
Regards,
Rustam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2010 03:47 AM
тАО07-09-2010 03:47 AM
Re: The tar utility
># tar -cvf data-
>I don't know why, maybe I got misunderstand of syntax
There's no syntax :-)
just a suggestion.
You have to define a variable first:
set DATUM=`date +%y%m%d`
Then you can use:
# tar -cvf data-$DATUM.tar /data
(This is in csh-shell)
HTH
V.