Skip to content

Commit f040ef4

Browse files
committedJan 11, 2012
First cut at making database backups work again.
1 parent c867496 commit f040ef4

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed
 

‎wre/etc/wre.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090
"path" : "/backup",
9191
"mysql" : {
9292
"user" : "backup",
93-
"password" : "xxxxxxx"
93+
"password" : "xxxxxxx",
94+
"enabled" : 1
9495
},
9596
"items" : [ ##List of directories, wildcards are okay
9697
"/data/domains", ##All domain files
@@ -101,7 +102,7 @@
101102
"externalScripts" : [],
102103
"rsync" : {
103104
"enabled" : 0,
104-
"rotations" : 3,
105+
"rotations" : 3, ##Number of remote backups.
105106
"hostname" : "rsync.example.com",
106107
"user" : "rsyncuser",
107108
"path" : "."

‎wre/sbin/backup.pl

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sub backupMysql {
4242
my $config = shift;
4343

4444
# should we run?
45-
return undef unless $config->get("backup/items/mysql");
45+
return undef unless $config->get("backup//mysql/enabled");
4646

4747
# disable wremonitor to prevent false positives
4848
$config->set("wreMonitor/nginxAdministrativelyDown", 1);
@@ -63,7 +63,7 @@ sub backupMysql {
6363

6464
# skip some databases
6565
next if ($name =~ /^demo\d/);
66-
next if ($name =~ /^test$/);
66+
next if ($name eq 'test'/);
6767

6868
# create dump
6969
$mysql->dump(
@@ -153,13 +153,13 @@ =head1 SYNOPSIS
153153
=head1 DESCRIPTION
154154
155155
This wre script backups all files and databases according to the wre.conf and
156-
backup.exclude files. This script is advised to be run as a root owned cronjob.
156+
backup.exclude files. This script is best run as a root owned cronjob.
157157
158158
Please see L<wre.conf.pod> for the backup options.
159159
160-
=head2 backup.exclude
161-
162-
A file that contains patterns of file locations and filenames that should not be backed up. This is used by the tar --exclude-from option.
160+
The script will ignore the test database, and any database that looks like it might
161+
come from the demo system. The demo system databases are identified by any name that
162+
starts with "demo" and then a digit, C<^demo\d>.
163163
164164
=over 4
165165

0 commit comments

Comments
 (0)
Please sign in to comment.