#!/bin/csh
# Backs up all files; removes .o's, recompiles after clean
# Run best when server is down
# Written by Locke.

set filepath = /db/theisles/isles

cd $filepath
cd area
rm nohup.out
cd ../log
rm *


while ( 1 )
    # If you want to have logs in a different directory,
    #   change the 'set logfile' line to reflect the directory name.
    set index = 1000
    while ( 1 )
	set backupdir = $filepath/backups/$index.backup
	if ( ! -e $backupdir ) break
	@ index++
    end

    echo Cleaning.

    cd $filepath/src
    make
    cp $filepath/src/nimud $filepath/src/current

    exit
end
