Sponsored Content
Top Forums Shell Programming and Scripting taking backup en getting info about it Post 16984 by eddyvdv on Saturday 9th of March 2002 03:35:33 PM
Old 03-09-2002
taking backup en getting info about it

I want to write a script that tells me if the tape device is ready, if the answer is not yes ($?is not 0) i get an answer that the tape_device is not ready. If the tape is ready i can do a
tar -cvf $tape1 * .
How can i write a script to control if the tapedevice is ready or not?

How can i write a script so i get an output on a file that tells me how many files are backup-ed.

i thought about the commands
tar -tvf $tape1 > mylist
and then do the command wc -l mylist
but how can i put the output into a variable for exemple $Mynumber, i thought about the command 'read 'but i dont know how to write it
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Taking System Backup

Hello Guys: Would like to know how to take an entire system backup.. Here is the entire scenario.. I am working on a system that is AIX RS6000 M80 Server. We have loaded the OS and installed all the patches and then we took an entire system backup. We also verified by restoring the same... (2 Replies)
Discussion started by: ST2000
2 Replies

2. UNIX for Advanced & Expert Users

Showing Device Does Not Exist While Taking Backup

Friends, while taking backup on /dev/rmt/0cn it is showing device does not exists. I have checked /dev/rmt 0cn is present there with link file created in /devices/pci@8,700000/scsi@5/st@5,0:cn I have checked cd /devices/pci@8,700000/scsi@5 but st@5,0:cn is not there. But I found st@3,0:cn. ... (3 Replies)
Discussion started by: ailnilanjan
3 Replies

3. UNIX for Dummies Questions & Answers

Check backup file size on backup tape

Hi, I performed backup on tape and I want to append more files to my previous backup on the same backup tape. But before I do that I need to know the backup file size of the first backup I performed so that I know the available size on the backup tape. Can someone help me what command I will use... (0 Replies)
Discussion started by: ayhanne
0 Replies

4. SCO

Backup to SCSI Tape Backup aborts

I am trying to make a full backup of my system using the cpio command. The Tape Unit is a SCSI DDS. The process started fine but after about 30 minutes, it just stopped and showed the following message: 1755 Signal 31 - Core dumped Any idea of what is causing this and how to fix it? ... (4 Replies)
Discussion started by: zionpc
4 Replies

5. UNIX for Advanced & Expert Users

backup a file and keep every version of the backup

I am trying to backup my .bash_history and I want to keep every version of the backup. I am thinking to put one of these in my crontab. 0 0 * * 0,3 cat .bash_history > boo 0 0 * * 0,3 cp .bash_history boo I would like the backups to be called boo1, boo2, boo3, etc. I would like to keep... (7 Replies)
Discussion started by: cokedude
7 Replies

6. Shell Programming and Scripting

Script for taking backup of desktop files.

Hi Friends, I need help. I have around 100 users. I want to take date wise backup of files which are on desktop for every user. My user directory path is -: /home/dr/<user_name>/Desktop 1) Script has to run on a perticular time everyday 2) Script has to take backup of all files present... (2 Replies)
Discussion started by: paragnehete
2 Replies

7. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

8. HP-UX

Temp folder Getting full while taking backup.

Hi Experts, When i taking backup of my servers in Tape Library simultaneously the Temp folder is getting full...... these file like OB2DBG*.txt (2 Replies)
Discussion started by: purushottamaher
2 Replies

9. Shell Programming and Scripting

Help with Backup Shell Script for Network Device Configuration backup

HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here Im explaining the requirement of script. AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Discussion started by: saichand1985
4 Replies
mt(1)							      General Commands Manual							     mt(1)

NAME
mt - Magnetic tape manipulating program SYNOPSIS
mt [-f tape_device] command [count] The mt program gives commands to a magnetic tape drive. OPTIONS
This option specifies the tape device to be manipulated. This option specifies the number of times that the operation is to be repeated. DESCRIPTION
If you do not specify a tape name with the -f option, the TAPE environment variable is used; if TAPE does not exist, mt uses the /dev/ntape/tape0_d0 device. Note that tape_device must refer to a raw (not block) tape device. By default, mt performs the requested operation once. You can perform operations more than once using the count option. The following commands are available: Backspaces count files. Backspaces count records. Writes count End-of-File marks at the current position on the tape. Forward spaces count files. Forward spaces count records. This option prepares a SCSI tape for loading into the device. Not all SCSI tape drives support this command. Rewinds the tape and places the tape unit offline (count is ignored). Bring a SCSI tape to the ready state if a tape is in the tape path. Currently, this command is only supported in the SCSI/CAM tape driver. Not all SCSI tape drives support this functionality. Rewinds the tape (count is ignored). Sets the tape at the specified read position coordi- nates. The data obtained when using the rdpos option can be used as an argument to the seek or seekds commands. Use the following options with the rdpos command: The read position short format. This option requires a tape coordinate argument in the following syntax: # mt -f /dev/ntape/tape1 rdpos s READ POSITION short format First block: 3 (0x3) Last block: 0 (0x0) Number of blocks: 0 (0x0) Number of bytes: 0 (0x0) The preceding example provides the following information: The block address associated with the current logical position. The block address associated with the next block to be transferred from the buffer to the medium. The number of data blocks that have not been written to the medium. The number of data bytes that have not been written to the medium. In addition to the information provided by the preceding example, the rdpos s option may display additional messages. Availability of these additional messages depends on the capabilities of the tape drive device. You will only see such error messages if the tape device is configured to detect the error state and to display the appropriate message: An error has occurred and the tape posi- tion cannot be returned. An error has occurred as the device is incapable of reporting block locations. Number of bytes in the buffer field does not represent the actual number of bytes in the buffer. Number of blocks in the buffer field does not represent the actual number of blocks in the buffer. The logical unit is positioned between early-warning and the end of media (EOM). The logical unit is at the beginning of media (BOM). The read position long format. This option requires an argument in the following syntax: # mt -f /dev/ntape/tape1 rdpos l READ POSITION long format File number: 0 (0x0) Block number: 3 (0x3) The following information is returned: The number of file marks between BOM and current logical position. The number of logical blocks between BOM and the current logical position. In addition to the information provided by the preceding example, the rdpos l option may display additional messages. Availability of these additional messages depends on the capabilities of the tape drive device. You will only see such error messages if the tape device is configured to detect the error state and to display the appropriate message: An error has occurred as the device is incapable of reporting block locations. File Number and Set Number are unknown The logical unit is positioned between early-warning and the end of media (EOM). The logical unit is at the beginning of media (BOM). The read position short format, with device-spe- cific addresses. This option only works on certain devices and requires a tape coordinate argument as for the s option. The output will be the same format as for the s option, although the device-specific data bytes may differ if the device supports its own format. Not all devices support their own format. If the d option is not supported by the device, the following error mes- sage will be displayed: MTIOCRDPOS (dev_specific): I/O error Space to end of recorded data. Currently, this command is only supported in the SCSI/CAM tape driver. Not all SCSI tape drives sup- port this functionality. Positions a tape at the specified coordinates. The output of the rdpos command may be used as an argument to this command. You can specify the value from the First block field when using the s option. Positions a tape at the specified coordinates. You can use the output from the rdpos command as an argument, and the syntax is as for the seek command. Unlike the general seek command, the seekds command is device-specific. Some tape devices provide a device-specific format for accessing the media position, which differs from the SCSI logical block format defined by the SCSI standard. The device-specific format may provide a faster way of seeking to a particular position on the tape. Prints status information about the tape unit. Prepares a SCSI tape for removal from the device. Not all SCSI tape drives support this functionality. Only as many characters as are required to uniquely identify a command need to be specified. EXIT STATUS
The mt command returns the following exit status: Success. Command was unrecognized. Operation failed. FILES
Raw magnetic tape interface with no rewind when closed. Raw magnetic tape interface with rewind when closed. SEE ALSO
Commands: dd(1) Functions: ioctl(2) mt(1)
All times are GMT -4. The time now is 12:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy