home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
ot_archive.sh
< prev
next >
Wrap
Linux/UNIX/POSIX Shell Script
|
1997-10-09
|
583b
|
33 lines
#!/bin/sh
#
# %W% %G%
#
# Script to archive and compress a repository or project directory.
#
# Assumes that 'tar' and 'gzip' are in the current search path.
#
if [ $# != 2 ]; then
echo 1>&2 "Usage: ot_archive <sourceDirectory> <destinationFile>"
exit 1
fi
src=$1
dst=$2
dstT=${dst}.tar
dstZ=${dstT}.gz
echo "Creating archive $dstT ..."
echo "(working directory is `pwd`)"
if tar cf $dstT $src; then :; else
exit 1
fi
echo "Compressing archive into $dstZ ..."
rm -f $dstZ
if gzip $dstT; then :; else
exit 1
fi
echo "Ready."
exit 0