backup
rot/backup · 1.8 KB
From the archive UW1.tar.gz
Download the archive « Back to the archive contents
#!/bin/sh
#
# MUD Backup Script - Written by Dan aka Darkwolf
# mudadmin@daisy.goodnet.com
#
# Modified 12/18/02 - Nemesis - ReWrote for use w/
# RoT/Rom Muds. May need little mods for preference.
# telnet://insomnia.kyndig.com:9000
# Set the backup dir. The path you want the backup files to reside
BDIR=backup
# Set the dir that rot resides in.
CDIR=rot
BACK=../
# These are the tar flags. Man tar for info on the flags,
# Default shows verbose output of whats happinin, take v out
# if you dont like this
TFLAGS=cvzf
# These are the names of backup files... these
# should be changed to the names of your folders.
# They are setup for a stock rot right now.
ALNAME=rot
ANAME=area
SNAME=src
PNAME=player
# Edit this only if tar, mv, or gzip is somewhere wierd :)
PATH=/bin:/usr/bin
##################################################################
# End of user spec's. #
# Do not edit below this line unless you know what you are doing #
##################################################################
DATE=`date +%m%d`
case "$1" in
all)
cd $SNAME
rm -rf *.o
cd $BACK
cd $BACK
tar $TFLAGS $ALNAME.$DATE.tar.gz $CDIR
echo Done with $ALNAME.$DATE.tar.gz
mv $ALNAME.$DATE.tar.gz $BDIR
;;
player)
tar $TFLAGS $PNAME.$DATE.tar.gz $PNAME
echo Done with $PNAME.$DATE.tar.gz
mv $PNAME.$DATE.tar.gz ../$BDIR
;;
area)
tar $TFLAGS $ANAME.$DATE.tar.gz $ANAME
echo Done with $ANAME.$DATE.tar.gz
mv $ANAME.$DATE.tar.gz ../$BDIR/
;;
src)
cd $SNAME
rm -rf *.o
cd $BACK
tar $TFLAGS $SNAME.$DATE.tar.gz $SNAME
echo Done with $SNAME.$DATE.tar.gz
mv $SNAME.$DATE.tar.gz ../$BDIR/
;;
*)
echo "Usage ./backup {all|player|area|src}"
exit 1
esac
exit 0