backup
1stMud4.5.3/bin/backup · 978 B
From the archive firstmud-4.5.3.tar.gz
Download the archive « Back to the archive contents
#!/bin/bash
#
# Backup script by Markanth (14/06/2004)
# You can have crontab schedule backups by placing:
#
# 1 1 * * 7 /path/to/bin/backup all
#
# which will backup everything every sunday
#
# Change this to the absolute path to your 1stMud directory
cd /home/dlmud/1stMud
a=`date +%d-%m-%y`
excl=backup/.exclude-tar
case "$1" in
all)
$0 player
$0 area
$0 data
$0 src
echo Done backup all.
;;
player)
file=backup/player-$a.tar.gz
tar cvzfX $file $excl player
echo Done with $file.
;;
area)
file=backup/area-$a.tar.gz
tar cvzfX $file $excl area
echo Done with $file.
;;
data)
file=backup/data-$a.tar.gz
tar cvzfX $file $excl data
echo Done with $file.
;;
src)
file=backup/src-$a.tar.gz
tar cvzfX $file $excl src
echo Done with $file.
;;
clean)
rm -rf backup/*.tar.gz
echo Done cleaning backups.
;;
*)
echo "Usage $0 [all|player|area|src|data|clean]"
exit 1
esac