####################################### Tape archives and backups ####################################### ***manipulating tape with mt mt -f /dev/nrst1 status mt -f /dev/nrst1 asf n # n=no. of file to position at where first file on tape is 0 mt -f /dev/nrst1 eom # go to end of tape mt -f /dev/nrst1 rewind mt -f /dev/nrst1 erase # be patient esp. with Exabyte mt -f /dev/nrst0 retension # recommended for QIC 150 *** backups with cpio cpio allows names files to be restored cd /home # move to top directory for backup so directory entries in archive are relative mt -f /dev/nrst1 eom # to move to end of tape - will overwrite first file otherwise for full backup: find . -cpio /dev/nrst1 -print > date.backup for incremental backup (e.g. since date of last logfile find . -newer prev-date.backup -cpio /dev/nrst1 -print > date.backup to get table of contents from tape cpio -itB < /dev/nrst1 *** backups with tar tar does not allow individual files to be restored - only whole group cd topdirectory mt -f /dev/nrst1 eom # position at end of tape if necessary to create archive on tape tar cvf /dev/nrst0 *** dump of entire partition dump 0cstf 620 18 /dev/nrst0 /dev/sd0a 0 => full dump 620 18 => QIC 150 /dev/nrst0 => target for dump /dev/sd0a => partition being backed up *** *** reading VAX tapes *** backup tapes with vmsbackup vmsbackup -tf /dev/nrst1 # table of contents for whole tape vmsbackup -ts 1 -f /dev/nrst1 # table of contents for file 1 first file is number 1 vmsbackup -xs 1 -f /dev/nrst1 # extract is possible to specify file to extract but have only had luck specifying wildcard names vmsbackup -x -d -s 1 -f /dev/nrst1 # extract preserving VMS directory structure starting with current directory as [] note - get errors with directories of certain backup files, but is possible to read subsequent backup files by using s option also note - get "snark" errors on restoring files, but data seems OK vms copy tapes with dd mt -f /dev/nrst1 asf n # nth file on tape dd if=/dev/nrst1 ibs=8192 of=whatever #block size on vms tapes=8192 ################################################ information - system or process or queues ################################################ disk df # disk space on system quota -v # disk quota for you print queue lpq #inspect entries to queue lprm n # remove entry n from queue cpu usage top # review top users of cpu time cmd # stats for "cmd" - cpu use, disk access, etc process set # list aliases setenv or printenv # list environment setting stty [all] #show terminal characteristics jobs ps -ax # list all processes on system ps -arx # list all running processes on system ps -rx # list only your own running processes which file # where along path is "file" found first w # list users on system who # same as w but different format whois user # get info about user (University wide) memory vmstat # general statistics about kernel pstat -s # swap space info disk dkinfo # info about disk partition swapon # turning on swap space pstat -s # swap space info ################################################################# network and information ################################################################# nslookup # to lookup an ip number or node name telnet nodename 25 # connect to mail interface - can query # existence of individual users with VRFY ################################################################ Window Managers ################################################################ *** to run Motif window manager cp .xinitrc.mwm .xinitrc startx *** to run Open Look cp .xinitrc.olwm .xinirc openwin ################################################################### system procedures ################################################################## vipw # to edit password file mkfs # to make file system (new disk) see also file /etc/fstab makedev # to install new device (disk or tape) *** to reset modem cd /etc cp ttytab.nomodem ttytab # disable getty on ttya kill -HUP 1 # to restart init with new term info kermit set line /dev/ttya set speed 19200 connect at #suncmd tool doesn't give needed at&v #use xterm ats0=6 #to initiate modem answer on 6th ring ^\c #to return to kermit control prompt quit cp ttytab.modem ttytab #put ttya under getty control kill -HUP 1 *** modem stored configurations look like this: ACTIVE PROFILE: DTE:19200 DCE:14400 PARITY:NONE ACTIVE PROFILE: DTE:19200 DCE:14400 PARITY:NONE B16 B1 E0 L2 M1 N1 P Q1 V1 W0 X4 Y0 &A0 &B1 &C0 &D0 &G0 &J0 &K3 &L0 &Q5 &R0 &S0 &T4 &U0 &X0 &Y0 S00:006 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:050 S08:002 S09:006 S10:014 S11:095 S12:050 S18:000 S25:005 S26:001 S30:000 S36:007 S37:011 S38:020 S43:000 S46:002 S48:007 S49:064 S50:220 S63:000 S82:128 S86:000 S95:000 S97:030 S108:001 S109:062 S110:002 STORED PROFILE 0: B16 B1 E0 L2 M1 N1 P Q1 V1 W0 X4 Y0 &A0 &C0 &D0 &G0 &J0 &K3 &L0 &Q5 &R0 &S0 &T4 S00:000 S02:043 S06:002 S07:050 S08:002 S09:006 S10:014 S11:095 S12:050 S18:000 S25:005 S26:001 S30:000 S36:007 S37:011 S38:020 S46:002 S48:007 S63:000 S82:128 S95:000 S97:030 S108:1 S109:062 S110:2 STORED PROFILE 1: B16 B1 E0 L1 M1 N1 P Q1 V1 W0 X4 Y0 &A0 &C1 &D3 &G0 &J0 &K3 &L0 &Q5 &R0 &S0 &T4 S00:006 S02:043 S06:002 S07:090 S08:002 S09:006 S10:014 S11:095 S12:050 S18:000 S25:005 S26:001 S30:000 S36:003 S37:000 S38:002 S46:002 S48:007 S63:000 S82:128 S95:000 S97:030 S108:1 S109:062 S110:2 TELEPHONE NUMBERS: &Z0= &Z1=40577 &Z2= &Z3= *** to check memory on boot /etc/halt n # for "new command mode" help #for options choose system configuration change appropriate parameter ################################################################## c shell procedures ################################################################## rehash # update files along path *** to copy entire directory structure: tar -cf - . | (cd newdirectory ; tar -xf -) across network (putative) tar -cf - . | rsh cryoem.med (cd newdirectory ; tar -xf -) *** to make global change in filenames (in this case, ; to .) foreach F (*.*\;*) #for filenames *.*;* mv $F 'echo $F | sed -e "s/;/./g"' end *** to strip off file extensions foreach F (*.*) mv $F $F:r end *** to use VAX-like wildcard - e.g. mv file.ext file.newext mv file.ext !#:1:r.newext *** to remove ^Z from file (maybe doesn't work) sed -e s/\O032//g file > file.fixed *** to replace a line in a file with another line (see pick.iterate) first step is to find line number to replace (unless you already know) next step is to replace this line with desired text set lineno=`grep -n "TEXT TO SEARCH FOR" infile | cut -d: -f0` sed -e "$lineno c\\ TEXT TO PUT ON LINE" infile > outfile *** printing enscript # converts to text file to postscript psroff -man /usr/share/man/man1/csh.1 # man page to postscript manpage # print man page to PS printer for postscript debugging put "executive" as 2nd line in postscript file - then print filename #print is script Steve wrote