-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathupdate_cxgn_db
More file actions
executable file
·50 lines (29 loc) · 1.06 KB
/
Copy pathupdate_cxgn_db
File metadata and controls
executable file
·50 lines (29 loc) · 1.06 KB
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
#!/usr/bin/env perl
use Modern::Perl;
use autodie qw/:all/;
=head1 update_cxgn_db - update the local cxgn database
Usage:
./update_cxgn_db
=head1 WARNING
This will replace your local cxgn db backup with the nightly backup from eggplant using rsync --inplace to minimuze bandwidth consumption.
Don't CTRL-C or kill -9 this script, or you could corrupt your local database backup.
You have been warned.
This script is meant to be used in conjunction with replace_cxgn_db.
=head1 EXAMPLES
The following command
update_cxgn_db && replace_cxgn_db
will grab a nightly production snapshot of the the cxgn db from eggplant,
drop the local cxgn database, and replace it with the nightly snapshot.
This is usually much simpler (but slower and more bandwidth-consuming)
than applying many dbpatches manually.
=head1 AUTHOR
Jonathan "Duke" Leto
=cut
my $backup = "db.cxgn.pgsql.gz";
unless (-e $backup ) {
die "Can't find $backup to update!";
}
my $update_cmd =<<CMD;
rsync -avz --inplace eggplant.sgn.cornell.edu:/data/prod/dumps/$backup .
CMD
system $update_cmd;