-
Notifications
You must be signed in to change notification settings - Fork 1
/
backup
executable file
·80 lines (66 loc) · 1.88 KB
/
backup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh
#
# Smaug Backup script by Dan aka Darkwolf aka Mnementh
# mudadmin@daisy.goodnet.com
#
#
# Set the backup dir. The Path you want the backup files to reside
#
BDIR=./bekap
#
# Set the dir that smaug resides in, default is /dist
#
CDIR=./
#
# 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=cvf
#
# The gzip lvl, or level of compression
# -1 is lowest and fastest, -9 is best and slowest
#
GZL='-6'
#
# 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`
cd $CDIR
case "$1" in
all)
tar $TFLAGS $BDIR/Player.$DATE.tar lib/plralias lib/plrobjs lib/etc \
gzip $GZL $BDIR/Player.$DATE.tar
echo Done with $BDIR/Player.$DATE.tar.gz
tar $TFLAGS $BDIR/Area.$DATE.tar lib/world lib/misc lib/text lib/house lib/salesman lib/maps
gzip $GZL $BDIR/Area.$DATE.tar
echo Done with $BDIR/Area.$DATE.tar.gz
tar $TFLAGS $BDIR/Src.$DATE.tar src
gzip $GZL $BDIR/Src.$DATE.tar
echo Done with $BDIR/Src.$DATE.tar.gz
;;
player)
tar $TFLAGS $BDIR/Player.$DATE.tar ib/plralias lib/plrobjs lib/etc
gzip $GZL $BDIR/Player.$DATE.tar
echo Done with $BDIR/Player.$DATE.tar.gz
;;
area)
tar $TFLAGS $BDIR/Area.$DATE.tar lib/world lib/misc lib/text lib/house lib/salesman lib/maps
gzip $GZL $BDIR/Area.$DATE.tar
echo Done with $BDIR/Area.$DATE.tar.gz
;;
src)
tar $TFLAGS $BDIR/Src.$DATE.tar src
gzip $GZL $BDIR/Src.$DATE.tar
echo Done with $BDIR/Src.$DATE.tar.gz
;;
*)
echo "Usage Backup {all|player|area|src}"
exit 1
esac
exit 0