restore
restore功能说明:还原(Restore)由倾倒(Dump)操作所备份下来的文件或整个文件系统(一个分区)。
语 法:restore [-cCvy][-b <区块大小>][-D <文件系统>][-f <备份文件>][-s <文件编号>] 或 restore [-chimvy][-b <区块大小>][-f <备份文件>][-s <文件编号>] 或 restore [-crvy][-b <区块大小>][-f <备份文件>][-s <文件编号>] 或 restore [-cRvy][-b <区块大小>][-D <文件系统>][-f <备份文件>][-s <文件编号>] 或 restore [chtvy][-b <区块大小>][-D <文件系统>][-f <备份文件>][-s <文件编号>][文件...] 或 restore [-chmvxy][-b <区块大小>][-D <文件系统>][-f <备份文件>][-s <文件编号>][文件...]
补充说明:restore 指令所进行的操作和dump指令相反,倾倒操作可用来备份文件,而还原操作则是写回这些已备份的文件。
参 数:
-b<区块大小> 设置区块大小,单位是Byte。
-c 不检查倾倒操作的备份格式,仅准许读取使用旧格式的备份文件。
-C 使用对比模式,将备份的文件与现行的文件相互对比。
-D<文件系统> 允许用户指定文件系统的名称。
-f<备份文件> 从指定的文件中读取备份数据,进行还原操作。
-h 仅解出目录而不包括与该目录相关的所有文件。
-i 使用互动模式,在进行还原操作时,restore指令将依序询问用户。
-m 解开符合指定的inode编号的文件或目录而非采用文件名称指定。
-r 进行还原操作。
-R 全面还原文件系统时,检查应从何处开始进行。
-s<文件编号> 当备份数据超过一卷磁带时,您可以指定备份文件的编号。
-t 指定文件名称,若该文件已存在备份文件中,则列出它们的名称。
-v 显示指令执行过程。
-x 设置文件名称,且从指定的存储媒体里读入它们,若该文件已存在在备份文件中,则将其还原到文件系统内。
-y 不询问任何问题,一律以同意回答并继续执行指令。
restore
restore flag [options] [files]
System administration command. Restore backed up files from a dump archive. Execute this command with one of the following flags.
Flags
Compare files on disk to files in the backup and print report.
Restore files interactively. This will open a shell-like interface that accepts the following commands.
add [name] Add the current working directory, or the specified file or directory name to the list of files to extract.
cd directory Change the current working directory.
delete [name] Remove the current working directory or the specified file or directory name from the list of files to extract.
extract Extract selected files. This will prompt for the volume on which the files to be extracted can be found. Once the files are extracted, the system will prompt if you want to change the ownership and mode of the current directory (the one to which you extracted the files) to match the settings on the dump's original base directory.
help Print a command summary.
ls [name] Like the shell command, list files in the current working directory, or the specified file or directory name. A * before a name indicates items marked for extraction. In verbose mode, the listing will include each item's inode.
pwd Like the shell command, print the working directory.
quit Exit the command.
setmodes Set ownership and mode of the directory to which you extract the files to match the settings on the dump's original base directory.
quit Exit the command.
verbose Verbose mode. Print inodes along with file and directory names when using ls.
Create a Quick File Access file suitable for use with the -Q option.
Prompt for the tape volume to fully restore.
Fully restore the backup to a clean, newly created ext2 filesystem. Execute this command in the root directory of the new filesystem.
Print files if they exist in the archive or an error if they do not. If no files are specified, list all files in the archive.
Recursively extract files if they exist in the archive. Restore owner, modification times, and modes. If no files are specified, restore the entire backup.
Options
Read all volumes to find the files to extract, beginning with volume 1. This will skip any volume prompts.
Read the table of contents from the specified archive file.
Specify the block size in kilobytes used for a block in the archive. Restore can usually determine this when reading the dump media.
Read dumps made prior to Version 4.4.
Print debugging information.
When using the -C flag, compare the dump to files on the specified filesystem.
Read the backup from the specified file: a device file, an ordinary file, or - to read from standard input. Use host:file or
user@host :file to read from a networked host using either the rmt program or the program specified by the RMT environment variable.
Run the specified script at the beginning of each volume. restore will pass the current device and volume number to the script. The script should return 0 to continue, 1 to prompt for a new tape, or any other exit value to abort the restore. The script will run with the process's real user and group ID.
Do not recursively restore directory. Only restore the specified directory.
Use Kerberos authentication when connecting to a remote server.
Treat file as a regular file instead of a tape device. Use this option when restoring from remote compressed files.
Used with the -C flag. Abort the comparison after encountering n errors.
Expect filenames to be given as inodes.
Restore from a multivolume backup. Treat any filename provided with -f as a prefix.
Perform all actions indicated by other flags and options, but don't write anything to the disk.
Automatically set ownership and mode of the current directory to match the original base directory of the dump.
Read tape positions from the specified Quick File Access mode file.
Read from volume n of a multifile backup.
Unlink (remove) any existing files before writing a file with the same name.
Verbose mode. Print information about files being restored.
Enable multivolume mode for devices other than tapes.
Read list of files and directories to extract from the specified file. Use - to retrieve list of files from standard input.
Attempt to skip over errors without prompting for operator input.