Basic AIX tape utility and scripting commands

AIX Tape Utility Commands

  • tapeutil To run the menu version
  • /dev/rmt0 = Tape drive
  • /dev/smc0 = Tape library
  • lsdev -Cc tape List the devices
  • tapeutil -f /dev/rmt0 mount 2 To mount tape from slot 2
  • tapeutil -f /dev/rmt0 unmount 2 To unmount tape from slot 2
  • restore -Tvqf /dev/rmt0 > file To list information on a tape saved with backup or savevg
  • tar tvf /dev/rmt0 > file To list information on a tape saved with tar
  • tcl -f /dev/rmt0.1 fsf 3; restore -Tvqf /dev/rmt0 > file To list information on a tape saved with mksysb
  • lsattr -l rmt0 -E To list the current values of the attributes for the tape device, rmt0



AIX script Commands

  • Script to compare condition with "or" "and" condition
    • condition1= $(ls -la | /tmp/file2.txt | wc -l)
    • condition2 = $(ls -la | /tmp/file2.txt | wc -l)
    • if [ "$condition1" = "1"  ] || [ "$condition2" = "2"  ] then echo "ok 1 or 2 is accepted" else echo "error only 1 or 2 is accepted"
    • if [ "$condition1" = "1"  ] && [  "$conditions2" = "2"  ] then echo "ok 1 and 2 is accepted" else echo "error only 1 and 2 is accepted"



File Transfer Protocol (ftp)

  • ftp://user:password@machine/../../directory Url of an ftp ressource



Server X

  • Start a server x
    • ps -ef | dtlogin (identifiy all the process dtlogin)
    • kill <PID> (kill the process from the result of the ps command)
    • cd /etc
    • sh rc.dt (Start the server X)



CD-ROM - DVD-ROM

  • CD-ROM utility
    • cdromd Automatically mounts a CD-ROM or DVD-ROM when it is inserted (man cdromd for more details)
    • cdeject Eject a media from a CD drive managed by the cdromd daemon
    • cdumount  Unmounts a previously mounted file system on a device managed by cdromd
    • cdmount Make a file system available for user on a device managed by cdromd
    • mount -V cdrfs -o ro /dev/cd0  /cdrom Mount a cd-rom

0 Comment to "Basic AIX tape utility and scripting commands"

Post a Comment