linux社区爱心援助Linux认证系列教程业界动态站务新闻公司招聘建议留言网址大全LPI专题CISCO专题
设为首页
加入收藏
管理团队
JSP  
JAVA  
PERL  
 您的位置:首页 > article > unix > unix入门 >
栏目导栏
资料搜索
热门文章
·SCO OpenServer系统手册
·solaris迅速查找手册
·UNIX常用命令-目录及文件操作命
·常见的“压缩与解压缩”方法
·SUN的入门培训资料
·Solaris FAQ 1.2
·UNIX系统操作入门篇
·unix大全下载基地
·教你如何配置安全的SOLARIS系统
·吐血奉献.samba安装设置!
·solaris常用命令及简单解释
·UNIX 常识总集~!
·Windows XP 与 Solaris 10 双操
·隆重推荐:Solaris硬盘分区简介
·UNIX基础知识
最新文章
·Solaris SSH的配置和管理介绍
·在Unix环境下mount ISO文件
·Solaris 管理员常用的168条命令
·solaris raid 制作大集合
·在Solaris下使用USB存储设备
·SecureCRT访问HPUX没办法用vi问
·scounix网络设置心得
·solaris网络配置
·solaris上直接运行linux二进制
·HP Unix的补丁安装
·系统备份与恢复命令:fbackup+
·Oracle 10g基于Solaris 9 x86平
·完全硬盘安装solaris10
·solaris点滴9.29-10.07
·solaris volume manager do RA
Google
 
磁带操作实用命令
[ 作者:Linux联盟收集  加入时间:2006-07-18 12:37:18  来自:Linux联盟收集 ]
Retensioning a Magnetic Tape FLGLinux联盟
FLGLinux联盟
If errors occur when reading a tape, retension the tape, clean the tape drive, and then try again. Type mt -f /dev/rmt/n retension and press Return. The tape in the tape drive you specify is retensioned. FLGLinux联盟
FLGLinux联盟
In this example, the tape in drive /dev/rmt/1 is retensioned: FLGLinux联盟
FLGLinux联盟
[color=red]oak% mt -f /dev/rmt/1 retension FLGLinux联盟
oak%[/color] FLGLinux联盟
FLGLinux联盟
Rewinding a Magnetic Tape FLGLinux联盟
FLGLinux联盟
To rewind a magnetic tape, type mt -f /dev/rmt/n rewind and press Return. The tape in the tape drive you specify by the device number n is rewound. FLGLinux联盟
FLGLinux联盟
In this example, the tape in drive /dev/rmt/1 is rewound: FLGLinux联盟
FLGLinux联盟
[color=red]oak% mt -f /dev/rmt/1 rewind FLGLinux联盟
oak%[/color] FLGLinux联盟
FLGLinux联盟
Showing the Status of a Magnetic Tape Drive FLGLinux联盟
FLGLinux联盟
To show the status of a magnetic tape drive, type mt -f /dev/rmt/n status and press Return. Status for the tape drive you specify is displayed. FLGLinux联盟
FLGLinux联盟
In this example, there is no tape in drive /dev/rmt /1: FLGLinux联盟
FLGLinux联盟
[color=red]oak% mt -f /dev/rmt/1 status FLGLinux联盟
/dev/rmt/1: no tape loaded or drive offline FLGLinux联盟
oak%[/color] FLGLinux联盟
FLGLinux联盟
In this example, status is shown for the tape in drive /dev/rmt/1: FLGLinux联盟
FLGLinux联盟
[color=red]oak% mt -f /dev/rmt/1 status FLGLinux联盟
Archive QIC-15Ø tape drive: FLGLinux联盟
   sense key(Øx6)= unit attention   residual= Ø   retries= Ø FLGLinux联盟
   file no= Ø   block no= Ø FLGLinux联盟
oak%[/color] FLGLinux联盟
FLGLinux联盟
The tar Command FLGLinux联盟
  FLGLinux联盟
Use the tar command to copy files and directory subtrees to a single tape. The advantages of the tar command are that it is available on most UNIX operating systems and public domain versions are readily available. The disadvantages of the tar command are that tar is not aware of file system boundaries, full path name length cannot exceed 255 characters, it does not copy empty directories or special files such as device files, and it cannot be used to create multiple tape volumes. FLGLinux联盟
FLGLinux联盟
The following sections describe how to use the tar command to copy files to a tape, list the files, append the files, and retrieve the files. FLGLinux联盟
FLGLinux联盟
Copying Files to a Tape (tar) FLGLinux联盟
FLGLinux联盟
Follow these steps to copy files to a tape:  FLGLinux联盟
FLGLinux联盟
1.  Change to the directory that contains the file you want to copy.  FLGLinux联盟
2   Insert a write-enabled tape into the tape drive.  FLGLinux联盟
FLGLinux联盟
FLGLinux联盟
-------------------------------------------------------------------------------- FLGLinux联盟
CAUTION! Copying files to a tape using the c option to tar destroys any files already on the tape. If you want to preserve the files already on the tape, use the r option described in "Appending Files to a Tape (tar)" later. FLGLinux联盟
-------------------------------------------------------------------------------- FLGLinux联盟
  FLGLinux联盟
Type tar cvf /dev/rmt/n filename filename filename ... and press Return.  FLGLinux联盟
FLGLinux联盟
The c (copy) option copies the files you specify, the v (verbose) option displays information about the files as they are copied, and the f (files) option followed by the tape device name specifies where the tar files are to be written. The file names you specify are copied to the tape, overwriting any existing files on the tape.  FLGLinux联盟
FLGLinux联盟
FLGLinux联盟
-------------------------------------------------------------------------------- FLGLinux联盟
NOTE:  You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file name argument. If you specify a directory name as the file name, the directory and all its subdirectories are recursively copied to the tape. FLGLinux联盟
-------------------------------------------------------------------------------- FLGLinux联盟
  FLGLinux联盟
4.  Remove the tape from the drive and write the names of the files on the tape label. FLGLinux联盟
In this example, two files are copied to a tape in tape drive 0:  FLGLinux联盟
FLGLinux联盟
[color=red]oak% cd /home/winsor FLGLinux联盟
oak% ls evaluation* FLGLinux联盟
evaluation.doc   evaluation.doc.backup FLGLinux联盟
oak% tar cvf /dev/rmt/Ø evaluation* FLGLinux联盟
a evaluation.doc 86 blocks FLGLinux联盟
a evaluation.doc.backup 84 blocks FLGLinux联盟
oak%[/color] FLGLinux联盟
FLGLinux联盟
Listing the Files on a Tape (tar) FLGLinux联盟
FLGLinux联盟
Follow these steps to list the files on a tape:  FLGLinux联盟
FLGLinux联盟
1.  Insert a tape into the tape drive.  FLGLinux联盟
2.  Type tar tvf /dev/rmt/n and press Return. The t (table) option lists the files you specify, the v (verbose) option displays complete information about the files as they are listed in a form similar to the ls -l command, and the f (files) option followed by the tape device name specifies the device where the tar files are located.  FLGLinux联盟
In this example, the table of contents for the tape in drive 0 contains two files:  FLGLinux联盟
FLGLinux联盟
[color=red]oak% tar tvf /dev/rmt/Ø FLGLinux联盟
rw-rw-rw-6693/1Ø  44032 Apr 23 14:54 1991 evaluation.doc FLGLinux联盟
rw-rw-rw-6693/1Ø  43008 Apr 23 14:47 1991 evaluation.doc.backup FLGLinux联盟
oak%[/color] FLGLinux联盟
FLGLinux联盟
Reading from left to right, the first column shows the permissions for the file; the second column shows the UID and GID file ownership; the third column shows the number of characters (bytes) in the file; the fourth, fifth, sixth, and seventh columns contain the month, day, date, and year the file was last modified, and the final column contains the name of the file.  FLGLinux联盟
FLGLinux联盟
Appending Files to a Tape (tar) FLGLinux联盟
FLGLinux联盟
Follow these steps to append files without overwriting files already on the tape:  FLGLinux联盟
FLGLinux联盟
1.  Change to the directory that contains the file you want to copy.  FLGLinux联盟
2.  Insert a tape that is not write-protected into the tape drive.  FLGLinux联盟
3.  Type tar rvf /dev/rmt/n filename filename filename ... and press Return. The file names you specify are appended to the files already on the tape in the drive you specify.  FLGLinux联盟
FLGLinux联盟
FLGLinux联盟
-------------------------------------------------------------------------------- FLGLinux联盟
NOTE:  You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file name argument. FLGLinux联盟
-------------------------------------------------------------------------------- FLGLinux联盟
  FLGLinux联盟
4.  Remove the tape from the drive and write the names of the files on the tape label.  FLGLinux联盟
In this example, one file is appended to the files already on the tape in drive 0:  FLGLinux联盟
FLGLinux联盟
[color=red]oak% cd /home/winsor FLGLinux联盟
oak% tar cvf /dev/rmt/Ø junk FLGLinux联盟
a junk 1 blocks FLGLinux联盟
oak% tar rvf /dev/rmt/Ø FLGLinux联盟
rw-rw-rw-6693/1Ø  44032 Apr 23 14:54 1991 evaluation.doc FLGLinux联盟
rw-rw-rw-6693/1Ø  43008 Apr 23 14:47 1991 evaluation.doc.backup FLGLinux联盟
rw-rw-rw-6693/1Ø     18 Dec 1Ø 11:36 1991 junk FLGLinux联盟
oak%[/color] FLGLinux联盟
FLGLinux联盟
You can put more than one set of tar files on a tape if you use the n (no-rewind) option as part of the tape device name. For example, type tar cvf /dev/rmt/nn filename. The tape is not rewound after the files are copied, and the next time you use the tape, the files are written at the end of the previous set of files.FLGLinux联盟
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·linux操作系统中安装和试用ie、office等软件  (2006-07-17 23:07:00)
 ·如何在安装了Windows操作系统的电脑上安装Linux操作系统  (2006-07-17 22:37:22)
 ·玩转Linux shell命令提示符  (2006-07-17 11:46:22)
 ·Java操作Excel的一种方法  (2006-07-15 10:43:52)
 ·SUN系统维护命令大全  (2006-07-11 20:12:05)
 ·在Solarsi8下使用命令行的方式安装及维护RAID1和RAID5  (2006-07-11 20:10:16)
 ·solaris 8.0常用命令及解释  (2006-07-11 20:05:53)
 ·Solaris2.4 多线程编程指南4--操作系统编程  (2006-07-11 19:47:09)
 ·恢复Linux操作系统的GRUB引导程序  (2006-07-11 10:26:33)
 ·solaris系统备份到HP DAT72磁带上  (2006-07-11 10:23:17)