- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- The tar command questions
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
05-20-2003 11:28 PM
05-20-2003 11:28 PM
The tar command questions
I would like to know how I can view a specific file in a backup tape quickly using tar?
Also, How can I know how many bytes I did backup all files in the tape?
Thanks very much!
Best Regards
ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2003 11:32 PM
05-20-2003 11:32 PM
Re: The tar command questions
what do you mean by "quicly" ?
As far as i know, there is no fast way , you can only use a "tar -tvf FILENAME" to list the content of the tar.
Tar has no funzionality like index in fbackup.
If you plan it, you can create an index file each time you create a tape, using
tar -cvf ARCHIVE FILES | tee -a /INDEXDIR/ARCHIVE.index
but this can only be usefull for the future.
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2003 11:36 PM
05-20-2003 11:36 PM
Re: The tar command questions
$ tar tvf myarchive /directory/filename
This will give the permissions/owner/bytes/date etc
To get the total you would have to write a small awk script to get total of the column of bytes.
$ tar tvf mayarchive >/tmp/archive.out
Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2003 11:45 PM
05-20-2003 11:45 PM
Re: The tar command questions
$ tar tvf myarchive >/tmp/wrk
$ cat /tmp/wrk | awk '{t1+=$3}
>END {printf("Total %d\n",t1)}'
Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2003 11:48 PM
05-20-2003 11:48 PM
Re: The tar command questions
As you can see, tar is not very useful as a general backup program. Perhaps you should look at fbackup or better, Data Protector or some other high end product.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2003 11:49 PM
05-20-2003 11:49 PM
Re: The tar command questions
Check list.txt.
No fast way here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2003 01:08 AM
05-21-2003 01:08 AM
Re: The tar command questions
Concerning the view of a specific file, managing an index could be ok.
But to check the amount of data in a tar file, dd could be even faster ...
For example :
> ll /tmp/a
-rw-rw-rw- 1 phelix CST 26767360 May 21 10:59 /tmp/a.tar
> dd if=/tmp/a.tar of=/dev/null bs=1024k
25+1 records in
25+1 records out
Which means that you have 26*1024k plus one incomplete record (less than 1024k) in the file.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2003 01:19 AM
05-21-2003 01:19 AM
Re: The tar command questions
if ur using /dev/rmt/0m tape device, to view a file the only way is
# tar tvf /dev/rmt/0m
To know howmany bytes, redirect the tvf output to a file.
# tar tvf /dev/rmt/0m >/tmp/tar.lst
Write a small script
x=0
for i in `cat /tmp/tar.lst|awk '{print $3}'`
do
x=`expr $x + $i`
done
echo $x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2003 03:06 AM
05-21-2003 03:06 AM
Re: The tar command questions
cd /var/tmp
dd ibs=10k if=/dev/rmt/0m of=archive.gz