7 =head1 replace_cxgn_db - replace the local cxgn database
14 ./replace_cxgn_db db.backup.gz
18 This will drop your local cxgn database and repopulate it with a backup file. Don't run
19 this command if you have things you want in your local db that are not in the backups!
28 my $db_file = shift || 'db.cxgn.pgsql.gz';
30 my $drop_db = "sudo -u postgres dropdb cxgn";
31 my $replace_db = "zcat $db_file | sudo -u postgres psql cxgn";
32 my $new_db = "sudo -u postgres createdb -E SQL_ASCII -T template0 cxgn";
34 die "Cannot find $db_file" unless -e
$db_file;
36 print "Going to drop the cxgn database...\n";
37 # We don't care if this fails
38 eval { system $drop_db };
40 print "Going to make a new cxgn database...\n";
43 print "Going to replace the cxgn database...\n";