diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-04 21:10:27 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-04-04 21:10:27 +0800 |
commit | 6ced28ac60c2f2e6ba64533a80d3326f9f5c9257 (patch) | |
tree | 6ff3c98e0d0ac21e9edde64c3222795ff3d85d5b /util | |
parent | 0fe23d901760a52ed2b076563af6f2a41a23a7ad (diff) | |
download | pttbbs-6ced28ac60c2f2e6ba64533a80d3326f9f5c9257.tar pttbbs-6ced28ac60c2f2e6ba64533a80d3326f9f5c9257.tar.gz pttbbs-6ced28ac60c2f2e6ba64533a80d3326f9f5c9257.tar.bz2 pttbbs-6ced28ac60c2f2e6ba64533a80d3326f9f5c9257.tar.lz pttbbs-6ced28ac60c2f2e6ba64533a80d3326f9f5c9257.tar.xz pttbbs-6ced28ac60c2f2e6ba64533a80d3326f9f5c9257.tar.zst pttbbs-6ced28ac60c2f2e6ba64533a80d3326f9f5c9257.zip |
getbackup.pl
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@77 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/Makefile | 4 | ||||
-rw-r--r-- | util/getbackup.pl | 31 |
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' ){ +} + |