UNIX Checking Tape Space


 
Thread Tools Search this Thread
Operating Systems Solaris UNIX Checking Tape Space
# 8  
Old 11-21-2013
Okay, that tells me a lot. Smilie Your "ubackups" program is probably a custom script, but it just uses tar to write to the tape...

Scan to the end of the tape with
Code:
tar tvf /dev/rmt/0n

0n is the same tape device but non-rewinding: It leaves the tape where it finished when tar is done. This lets you do mt -f /dev/rmt/0n tell to tell you the current position of the tape (probably in blocks of 512, not bytes, though other blockisizes are possible) and figure out exactly how much has been stored on it.

Then you can mt -f /dev/rmt/0n rewind to rewind the tape.
This User Gave Thanks to Corona688 For This Post:
# 9  
Old 11-21-2013
Sweet! Thank you so much! On my way to try it now.
# 10  
Old 11-21-2013
The 'tvf' options just list a tar's contents, by the way. tar has accumulated a lot of cruft over the years but in the end it does just a few basic things:

Code:
# Create a tar archive.  Your backup application probably does this.
tar cf /path/to/archive list of files and directories to include
# Append to an existing tar archive.  Your backup application might do this.
tar rf /path/to/archive list of files and directories to include
# Extract a tar archive or part of a tar archive.
tar xf /path/to/archive [optional list of files to extract]
# List the contents of a tar archive without extracting them.
tar tvf /path/to/archive

'archive' can mean either file or tape -- tar uses them the same way.

The 'v' in tvf stands for verbose, which means 'print more information' -- 'xvf' would print filenames as it goes when 'xf' would not. It might be redundant for 't' but doesn't hurt either.

Last edited by Corona688; 11-21-2013 at 04:18 PM..
# 11  
Old 11-21-2013
The /dev/rmt/0 rewinds the tape after the operation.
Your previous backup is overwritten.
But it is easy to restore.
/dev/rmt/0n device enables you to append another backup file.
But in order to restore a certain file you need to use the mt commands
Code:
mt -f /dev/rmt/0n tell
mt -f /dev/rmt/0n fsf 1 # advance to the next file
mt -f /dev/rmt/0n bsf 1 # go backwards to the previous file
mt -f /dev/rmt/0n rewind # rewind to the beginning

# 12  
Old 11-21-2013
Again that depends on what his backup application is doing. It might be using these commands already.
# 13  
Old 11-21-2013
When I use tar tvf /dev/rmt/0n, I can see all the backups I have done. I have about six backups in a tape that I use only for Fridays. If you remember, I mentioned earlier that I use one tape for each day of the week.

However, when I attempted to input mt -f /dev/rmt/0n tell, my system did not recognize the command. Am I using the wrong syntax or is it possible that not all Unix machines have the same abilities as others?
# 14  
Old 11-21-2013
All UNIX is indeed not identical but mt ought to be available for Solaris... I was reading a Solaris manual page to figure out instructions for it. A few possibilities:

1) Maybe it's not in your PATH. 'whereis mt' or 'whence mt' may give you an absolute path to it, and then you can run it like /absolute/path/to/mt

2) It might not be installed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying tape-to-tape on UNIX

I am using a 4mm tape to backup my Unix system. However, I wanted to make a copy all of the files and archive headers (or just the archive headers if that's possible) created on one of my tapes to another 4mm tape. I only have one tape drive. Is there a command that will complete such task? ... (1 Reply)
Discussion started by: acoco
1 Replies

2. UNIX for Advanced & Expert Users

Checking the space for /archlog mount point script

I have the below shell script which is checking /archlog mount point space on cappire(solaris 10) server. When the space usage is above 80% it should e-mail. When i tested this script it is working as expected. #!/usr/bin/ksh export MAIL_LIST="tlr.voora@zamn.com" export ARCH_STATUS=`df -k... (1 Reply)
Discussion started by: dreams5617
1 Replies

3. Shell Programming and Scripting

Checking the space for /archlog mount point script

I have the below shell script which is checking /archlog mount point space on cappire(solaris 10) server. When the space usage is above 80% it should e-mail. When i tested this script it is working as expected. -------------------------------------------------------------------------... (0 Replies)
Discussion started by: dreams5617
0 Replies

4. Homework & Coursework Questions

Unix space checking script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Im still pretty new to this and could really use some help with this task "Write a script to check in the... (12 Replies)
Discussion started by: krolike
12 Replies

5. UNIX for Dummies Questions & Answers

Problem in checking space of mount.Please help me

Hi everyone, I am writing a script. As a part of this script, I wanted to check the space of few mounts, If the space usage percentage of the mount crosses over a certain limit then i wanted to display a warning message. The following is the command df -k | awk ' { if (($6 == "/export/temp")... (4 Replies)
Discussion started by: Sheethal
4 Replies

6. Solaris

Command used for checking space occupied by files & sub-direc's inside a mount in %?

Hi, I want to know the command which can be used for finding the % of disk space occupied by files & sub-folders inside a given mount in Sun Solaris For eg: I have /tmp/ folder when I sat df -k it will give the percentage of space used by /tmp/. Say if I want to see how much % the files &... (2 Replies)
Discussion started by: weblogicsupport
2 Replies

7. UNIX for Dummies Questions & Answers

checking for a space in a file name

hi members... another new probs... i need to check all the zip files in the server and check for a space or "`" in the file name and if found need to remove them and form a zip file. i tried using grep command to check for a space but with out success also when i tried checking for "`" as... (6 Replies)
Discussion started by: madhu_aqua14
6 Replies

8. UNIX for Advanced & Expert Users

Space free on tape /delete a single file on tape

Hi, I' using a sun solaris server, I would like to known if there is the possibility to control how many space is free on a tape and how I can delete a single file on a tape. Thanks DOMENICO (3 Replies)
Discussion started by: Minguccio75
3 Replies

9. UNIX for Advanced & Expert Users

Does tar do crc checking on a tape or tar file?

Trying to answer a question about whether tar table-of-contents is a good tool for verifying tape data. (1 Reply)
Discussion started by: tjlst15
1 Replies

10. UNIX for Advanced & Expert Users

Tape space used not correct

version: SCO 5.0.5 There is a file in /usr/local/bin called ' baktape ', I'm unsure whether this is a standard unix file or one created by someone who used to manage this server? Anyway, it backs up what is specified to be backed up to tape and then prints off a report. Problem: What comes... (2 Replies)
Discussion started by: system77
2 Replies
Login or Register to Ask a Question