summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/Makefile4
-rw-r--r--util/getbackup.pl31
2 files changed, 33 insertions, 2 deletions
diff --git a/util/Makefile b/util/Makefile
index fb606b99..a3dd02ac 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.7 2002/04/03 18:35:47 in2 Exp $
+# $Id: Makefile,v 1.8 2002/04/04 13:10:27 in2 Exp $
BBSHOME?=$(HOME)
OSTYPE?=linux
@@ -35,7 +35,7 @@ CPROGS= bbsmail BM_money post account birth deluserfile expire mandex\
PROGS= $(CPROGS) BM_money.sh backpasswd.sh mailog.sh opendice.sh\
openticket.sh stock.sh topsong.sh weather.sh stock.perl weather.perl\
toplazyBM.sh toplazyBBM.sh dailybackup.pl tarqueue.pl waterball.pl \
- filtermail.pl
+ filtermail.pl getbackup.pl
all: $(PROGS)
diff --git a/util/getbackup.pl b/util/getbackup.pl
new file mode 100644
index 00000000..5e566066
--- /dev/null
+++ b/util/getbackup.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+if( !@ARGV ){
+ print "usage:\tgetbackup.pl\tbrd BRDNAME\n";
+ print "\t\t\tman BRDNAME\n";
+ print "\t\t\tusr USERID [all|fav|frlist]\n";
+}
+
+chdir "/home/bbs/backup/";
+
+$prefix = substr($ARGV[1], 0, 1);
+if( $ARGV[0] eq 'usr' ){
+ `rm -Rf home`;
+ `tar zxvf home.$prefix.tgz home/$prefix/$ARGV[1]`;
+ if( $ARGV[2] ne 'all' && $ARGV[2] ne 'fav' && $ARGV[2] ne 'frlist' ){
+ print "usr command '$ARGV[2]' unknown\n";
+ exit;
+ }
+ if( $ARGV[2] eq 'all' ){
+ `rm -Rf /home/bbs/home/$prefix/$ARGV[1]`;
+ `mv home/$prefix/$ARGV[1] /home/bbs/home/$prefix/$ARGV[1]`;
+ }
+ elsif( $ARGV[2] eq 'fav' ){
+ `mv home/$prefix/$ARGV[1]/.fav /home/bbs/home/$prefix/$ARGV[1]/.fav`;
+ }
+ elsif( $ARGV[2] eq 'frlist' ){
+ `mv home/$prefix/$ARGV[1]/overrides /home/bbs/home/$prefix/$ARGV[1]/overrides`;
+ }
+}
+elsif( $ARGV[0] eq 'man' ){
+}
+