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/getbackup.pl | |
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/getbackup.pl')
-rw-r--r-- | util/getbackup.pl | 31 |
1 files changed, 31 insertions, 0 deletions
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' ){ +} + |