Thursday, June 08, 2006

AIX


inti inti karipap yang sedap...

--------------------------------------------------------------------------------

BACKUPS

--------------------------------------------------------------------------------

MKSYSB

------

mkszfile -f Creates /image.data file (4.x onwards)

mkszfile -X Creates /fs.size file (3.x)

mksysb -i (device of file) Creates a mksysb image

mksysb does not save any raw data and will not backup a filesystem that

is not mounted.

SAVEVG

------

savevg -if (device or file) (vg) Creates a savevg image

restvg -q -f (device or file) Restore from a savevg image

Ensure that the restvg command is run from /

mkvgdata (vg) Creates new vgname.data file

CPIO ARCHIVE

------------

find (filesystem) -print | cpio -ocv > (filename or device)

eg find ./usr/ -print | cpio -ocv > /dev/rmt0

CPIO RESTORE

------------

cpio -ict < (filename or device) | more Lists archive

cpio -icdv < (filename or device)

cpio -icdv < (filename or device) ("files or directories to restore")

eg cpio -icdv < /dev/rmt0 "tcpip/*" Restore directory and contents

cpio -icdv < /dev/rmt0 "*resolve.conf" Restore a named file

TAR ARCHIVE

-----------

tar -cvf (filename or device) ("files or directories to archive")

eg tar -cvf /dev/rmt0 "/usr/*"

TAR RESTORE

-----------

tar -tvf (filename or device) Lists archive

tar -xvf (filename or device) Restore all

tar -xvf (filename or device) ("files or directories to restore")

use -p option for restoring with orginal permissions

eg tar -xvf /dev/rmt0 "tcpip" Restore directory and contents

tar -xvf /dev/rmt0 "tcpip/resolve.conf" Restore a named file

AIX ARCHIVE

-----------

find (filesystem) -print | backup -iqvf (filename or device)

Backup by filename.

eg find /usr/ -print | backup -iqvf /dev/rmt0

backup -(backup level 0 to 9) -f (filename or device) ("filesystem")

Backup by inode.

eg backup -0 -f /dev/rmt0 "/usr" -u option updates /etc/dumpdates file

AIX RESTORE

-----------

restore -qTvf (filename or device) Lists archive

restore -qvxf (filename or device) Restores all

restore -qvxf (filename or device) ("files or directories to restore")

(use -d for restore directories)

restore -qvxf /dev/rmt0.1 "./etc/passwd" Restore /etc/passwd file

restore -s4 -qTvf /dev/rmt0.1 Lists contents of a mksysb tape

BACKUPS ACROSS A NETWORK

------------------------

To run the backup on a local machine (cpio) and backup on the remote

machine's (remhost) tape drive (/dev/rmt0)

find /data -print | cpio -ocv | dd obs=32k | rsh remhost \

"dd ibs=32k obs=64k of=/dev/rmt0"

To restore/read the backup (cpio) on the remote machine

dd ibs=64k if=/dev/rmt0 | cpio -icvt

To restore/read the backup (cpio) on the local machine from the remote

machine's (remhost) tape drive (/dev/rmt0)

rsh remhost "dd ibs=64k obs=32k if=/dev/rmt0" | dd ibs=32k \

| cpio -icvt

To run the backup (cpio) on a remote machine (remhost) and backup to

the local machines tape drive (/dev/rmt0)

rsh remhost "find /data -print | cpio -ocv | dd ibs=32k" \

| dd ibs=32k obs=64k of=/dev/rmt0

tar cBf - . | rsh remhost "dd ibs=512 obs=512 of=/dev/rmt0"

Same as above but using tar instead of cpio.

0 comments: