Thursday, July 14, 2011

backup and restore



There are three types of backup methods:

1.     . Full backup
2.      .Incremental backup
3.      .Differential backup

FULL BACKUP
All the files are backed on the media using this.

DIFFERENTIAL BACKUP
Differential backup strategy first looks for modification time of the file and compares it with
The last full backup.

Only modified files are backed up, but only if they are changed after the latest full backup.

INCREMENTAL BACKUP
Incremental backup checks the difference between the modification time and the
Last backup time.
                                If the modified time is more recent than the  last backup date
The file is backed up.


SAVEVG

Savevg command is used to backup the user-defined volume group.
It doesn’t create bootable image.
The vg must be varied on and the filesystems to be backed up should be mounted.

Examples:
#savevg –i abhivg

It takes backup of abhivg to the default tape drive(/dev/rmt0)

#savevg –mf  /dev/rmt1 abhivg
This command backs up the abhivg and also create map file along with
a new abhivg.data file on rmt1 device

#savevg –ief /dev/rmt1  abhivg
This command backs up abhivg excluding the files listed in /etc/exclude.abhivg

#savevg –f /dev/rmt0 –V abhivg
This command backs up abhivg on tape /dev/rmt0 and also verifies the readability of file header.


Important files
/image.data – contains information about the rootvg.
 The savevg  command uses this file to create a backup image
That can be used by NIM to reinstall the VG to current system
Or to the new system.

/tmp/vgdata/vgname/vgname.data-
Contains information about the user defined volume group.
Savevg uses this file to create a backup image that can be used
By restvg command to remake that user defined VG.

RESTVG
This command restores the user defined volume group .

#restvg –f /dev/rmt0 hdisk hdisk3
To restore the VG image from /dev/rmt0 onto hdisk2 hdisk3

#restvg –r –f /dev/rmt0
To recreate the VG logical volume structure without restoring any files .

#restvg –l –f /dev/rmt0
To display VG information about the VG backed on the tape /dev/rmt0


BACKUP COMMAND
Backup command creates copies of your files on the backup media.

Backup command can be used for taking backup using :

1.                              Backing files By name( we use –i flag for this)
2.                             .Backing filesystems by i-node(we use –level flag for this)

Backing up files by name

The backup command reads the standard input for the names of the files to be
Backed up.
  File types can be special file,regular files or directories.
*if –p flag is specified only files of less than 2 gb are backed.

#find /home –print|backup –I –f /dev/rmt0
To backup all the files and directories in /home


#cd /home/abhi
#find . –print |backup –ivq

To backup all the files and subdirectories in the /home/abhi using the relative path.

Backing up filesystems by inode
To backup the filesystem by i-node , specify the “-level”
And “filesystem” parameter.

·        You must first umount the filesystem before backing up by i-node.

#backup -0 –u –f /dev/rmt0
-0 means all root filesystem files are to backed .
To backup root filesystem

#backup -1 –u –f /dev/rmt0
To backup all the files in root filesystem that are modified since the last
Level 0 backup.

RESTORE COMMAND
Restore command extracts the files backed up using the backup command.

#restore –xvqf abhi.bkup  system.data
To restore system.data file into the current directory from archieve
Abhi.bkup.the archieve is also in current directory.

#restore –xvdqf /dev/rmt0 /home/abhi/aks
To restore specific directory and its content from a file-name archieve.



No comments:

Post a Comment