Solaris data Backup and transfer tools

Source: Internet
Author: User
Tags file size file system insert rewind backup

(i) Data device name

1. Tape

Type Device Name Capacity Machine type
8mm D8112 5G 8205
8mm D8160 7G 8505-8705
8mm D8170 20G 8900
4mm DDS1 (60m) 1.3G
4mm DDS2 (120m) 7G
4mm DDS3 (125m) 12G

Device Name:/dev/rmt/0,/dev/rmt/0n (Not rewind)

2. Floppy disk

Device Name:/dev/fd0

3. Document

(ii) Data Backup command

The Solaris 2.x computing environment provides several commands for backing up and restoring files and file systems.

Multi-volume backup

Connection

System bridging

Ufsdump

Ufsrestore

Yes

No

No

Tar

No

Yes

Yes

Cpio

Yes

Yes

Yes

1.ufsdump command

The Ufsdump command is useful for system administrators to make a full or incremental dump of the entire file system.

A full dump is a backup of the entire file system. Do it at a longer interval, such as a week or January.

An incremental dump is a backup of a newly created or modified file. Incremental dumps are more frequent, possibly once a day.

The Ufsdump command provides different levels of dumps, from 0 to 9. The dump level is used to determine which files are backed up. Level 0 Designation

Full dump, 1 to 9 specifies an incremental dump of different levels. For example, an incremental dump (1 level) will be on the previous low level

(level 0) files that are modified or created after dumping are backed up. When you make a backup of the file system, you should go to run level s.

If the system is at run Level 3 o'clock, the file may be in use and may cause an invalid backup.

Example:

# ufsdump 0uf/dev/rmt/0/export/home

Options and Parameters:

0

Specifies a level 0 (full) dump.

U

Update the file/etc/dumpdates to record a successful dump.

F

Together with the following/dev/rmt/0 parameter, the tape device for the dump is determined.

/dev/rmt/0

A dump tape device.

/export/home

Specifies the file system to dump.

2.ufsrestore command

The Ufsrestore command copies files from the backup tape to the current directory.

The Ufsrestore command can be used to overload an entire file system or single or multiple files on a backup tape.

The option for the Ufsrestore command specifies the tape device name and the path name of the recovered file.

Recovery process

Use the Ufsrestore command to recover a file by using the following procedure:

# Cd/newdir

# Ufsrestore tuf/dev/rmt/0

3.tar command

The tar command is a user-level backup command for backing up and restoring files or directories.

Command format: tar options tape_device_name [filename]

Option C Create a new document V-Display path

T-display file list F-specified device

X-Extract Files I-interactive

Example:

(1) Backup process:

$ tar cvf/dev/rmt/0 *

(2) Recovery process:

$ tar xvf/dev/rmt/0

(3) directory replication

$ tar cvf-mydir| (CD Newdir;tar XVF-)

(4) Offsite copy (must be a trusted user)

$ tar cvf-mydir|rsh remote tar xvf-

4.cpio command

The Cpio (copy in/out) command is a user-level command that generates multiple volumes of backups.

Command format:

Cpio-ov >tape_device_name

Cpio-i [VT] <tape_device_name

Once it identifies the end of the media, it prompts you to insert another tape.

The Cpio command uses the output of the LS or find command to make a list of files that are exported to a file.

such as tape devices. It inserts a caption between files for easy recovery, so it's slower than the tar command.

The Cpio command can be used as a parameter, however, cpio the wildcard character, that is, in addition to matching criteria

File, it backs up all the files.

Backup process

$ find. -depth-print | Cpio-ov >/dev/rmt/0

The Find command provides a list of file and directory names to the Cpio command.

The-o option represents reading from standard output.

The/dev/rmt/0 parameter determines the tape device.

Example:

To back up the home directory to tape using the Find and Cpio commands:

Recovery process

Use the Cpio command to retrieve files and directories from tape using the following procedure.

1. Insert the tape into the tape device.

2. Change directory to/tmp directory.

3. Use the following Cpio directory to determine the pathname of the file to be recovered.

$ Cpio-iv </dev/rmt/0

The-I option extracts files, the V (verbose) option is combined with the T option to list files in ls-l format,

Use this composite option to display only file information and not extract files.

4. Restore the file to/tmp directory with the following Cpio command.

$ Cpio-iv < dev/rmt/0 Test.file

option I extracts files, v indicates that the file name is displayed when recovering.

5. Copy files from directory/TMP to the desired directory.

6. Remove the tape.

The following example shows how to recover a file with the Cpio command.

5.compress,uncompress,zcat command

The Compress command compresses files using a special format to reduce file size. Compression ratio from 20% to 80%.

For example, use the-v option to compress a file named Bin.file:

This file is compressed, plus the suffix. Z.

Zcat < File.taz|tar XVF-

6.MT command

Mt-f/dev/rmt/0 Status Report device state

Mt-f/dev/rmt/0 Rew Rewind Belt

Mt-f/dev/rmt/0n FSF 1 forward section

Mt-f/dev/rmt/0n BSF 3 back two paragraphs

7.DD command

DD if=/dev/rmt/0 of=/tmp/file bs=1024

8. Offsite use of tape drives (must be trusted users)

(1) Backup data to offsite tape drive

Tar Cvf-dirname|rsh remote DD of=/dev/rmt/0

(2) reading data from offsite tape drive

RSH remote DD if=/dev/rmt/0 tar xvf-

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.