#!/usr/bin/sh # dirtgz Daniel Brockman 060311 tars and zips current dir to zipfile in parent # # Usage: dirtgz # # Copyright Daniel Brockman. Permission granted to use with attribution. # # Dependencies: perl tgz.pl basename timestamp # PATH=/usr/bin:/bin:${PATH} export PATH ERR=0 # error code TS=`perl -S timestamp` # get date and time DIR=`pwd` # get cur dir pathname BN=`basename ${DIR}` # basename of cur dir #BN=x`basename ${DIR}` # basename of cur dir # test cd .. # to parent if [ -d ${BN} ] ; then # can find the dir we want to zip? perl -S tgz.pl ${BN} ${BN}.${TS} # tar and zip ERR=$? # ERR=999 # test if [ ${ERR}x != 0x ] ; then echo ${0}: ERROR: tgz.pl returns ERR=${ERR} 2>&1 fi else echo ${0}: ERROR: Cant find dir ${BN} in `pwd` 2>&1 ERR=1 fi #