AIX BackUp Commands


MKSYSB
——

mkszfile -f                Creates /image.data file (4.x onwards)
mkszfile -X                Creates /fs.size file    (3.x)

mksysb (device eg /dev/rmt0)

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 -icv | dd ibs=32k” \
| dd ibs=32k obs=64k of=/dev/rmt0

——————————————————————————–
Copying diskettes and tape
——————————————————————————–

COPYING DISKETTES
—————–

dd if=/dev/fd0 of=(filename) bs=36b
dd if=(filename) of=/dev/fd0 bs=36b conv=sync         or flcopy

COPYING TAPES
————-

dd if=/dev/rmt0 of=(filename)
dd if=(filename) of=/dev/rmt0        or tcopy

——————————————————————————–
VI Commands
——————————————————————————–

:g/xxx/s//yyy/   global change where xxx is to be changed by yyy

sed ‘s(ctrl v ctrl m)g//g’ old.filename > new.filename
Strips out ^M characters from ascii files that have been transferred as binary.
To enter crontrol characters type ctrl v then ctrl ? where ? is whatever
ctrl character you need.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s