gurba-0.40/
gurba-0.40/bin/
gurba-0.40/lib/
gurba-0.40/lib/cmds/guild/fighter/
gurba-0.40/lib/cmds/monster/
gurba-0.40/lib/cmds/race/catfolk/
gurba-0.40/lib/cmds/race/dwarf/
gurba-0.40/lib/cmds/verb/
gurba-0.40/lib/daemons/data/
gurba-0.40/lib/data/boards/
gurba-0.40/lib/data/messages/
gurba-0.40/lib/data/players/
gurba-0.40/lib/design/
gurba-0.40/lib/domains/gurba/
gurba-0.40/lib/domains/gurba/guilds/fighter/
gurba-0.40/lib/domains/gurba/monsters/
gurba-0.40/lib/domains/gurba/objects/armor/
gurba-0.40/lib/domains/gurba/objects/clothing/
gurba-0.40/lib/domains/gurba/objects/weapons/
gurba-0.40/lib/domains/gurba/vendors/
gurba-0.40/lib/kernel/cmds/admin/
gurba-0.40/lib/kernel/daemons/
gurba-0.40/lib/kernel/include/
gurba-0.40/lib/kernel/lib/
gurba-0.40/lib/kernel/net/
gurba-0.40/lib/kernel/sys/
gurba-0.40/lib/logs/
gurba-0.40/lib/pub/
gurba-0.40/lib/std/modules/languages/
gurba-0.40/lib/std/races/
gurba-0.40/lib/std/races/monsters/
gurba-0.40/lib/wiz/fudge/
gurba-0.40/lib/wiz/spud/
gurba-0.40/src/host/beos/
gurba-0.40/src/host/pc/res/
gurba-0.40/src/kfun/
gurba-0.40/src/lpc/
gurba-0.40/src/parser/
gurba-0.40/tmp/
#!/bin/bash
#
# standard backup script by Rust@TMI-2 (rust@virginia.edu) Jul 7, 1994
# reworked for more flexibility by Deatblade@Quendor (gstein@svpal.org)
#    on Mar 31, 1995
# Rust added an exec to a new expect script that automatically ftp's
# the backup to a remote host.
# - Deathblade took it back out and installed another cron
#   entry.  It made it a bit difficult to do a backup without
#   a mirror being done. :-)
# Jun 7, 1995: Deatbhlade altered for distinct daily backups with a running
#   monthly longterm backup.
#
# If you add the following entry to your crontab:
# 36 4 * * * ~/bin/backup  (assuming this is installed in ~/bin/backup)
# then this script will back up your lib daily into different files.
# The monthly will be hard link (therefore taking no extra disk space),
# but the link is "broken" at the turn of the month; essentially, it
# will drop off a copy each month.  This system provides for restoring
# from up to a few days and for long term archival.
#
#
# CONFIGURABLE STUFF
#
dgddir=/home/erlends/gurba
backupdir=$dgddir/backups
targetdir=$dgddir/lib
COMPRESSCMD=gzip
#
# END
#



base=$(basename $targetdir)
log=$backupdir/$base.log

echo Backup begun: $(date) >> $log

cd $targetdir/..

if [ -f ./$base/core ]; then
  mv ./$base/core ./core.$base.$(date +%y%m%d)
fi

tar -cf $backupdir/$base.tar ./$base
$COMPRESSCMD $backupdir/$base.tar

weekday=$(date +%w)
month=$(date +%m)
rm -f $backupdir/$base.$weekday.tar.gz
rm -f $backupdir/$base.$month.tar.gz
mv $backupdir/$base.tar.gz $backupdir/$base.day$weekday.tar.gz
ln $backupdir/$base.day$weekday.tar.gz $backupdir/$base.$month.tar.gz

echo "  Files: $base.day$weekday.tar.gz $base.$month.tar.gz" >> $log
echo Backup finished: $(date) >> $log