Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
First cut at making database backups work again.
  • Loading branch information
perlDreamer committed Jan 11, 2012
1 parent c867496 commit f040ef4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions wre/etc/wre.conf
Expand Up @@ -90,7 +90,8 @@
"path" : "/backup",
"mysql" : {
"user" : "backup",
"password" : "xxxxxxx"
"password" : "xxxxxxx",
"enabled" : 1
},
"items" : [ ##List of directories, wildcards are okay
"/data/domains", ##All domain files
Expand All @@ -101,7 +102,7 @@
"externalScripts" : [],
"rsync" : {
"enabled" : 0,
"rotations" : 3,
"rotations" : 3, ##Number of remote backups.
"hostname" : "rsync.example.com",
"user" : "rsyncuser",
"path" : "."
Expand Down
12 changes: 6 additions & 6 deletions wre/sbin/backup.pl
Expand Up @@ -42,7 +42,7 @@ sub backupMysql {
my $config = shift;

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

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

# skip some databases
next if ($name =~ /^demo\d/);
next if ($name =~ /^test$/);
next if ($name eq 'test'/);

# create dump
$mysql->dump(
Expand Down Expand Up @@ -153,13 +153,13 @@ =head1 SYNOPSIS
=head1 DESCRIPTION
This wre script backups all files and databases according to the wre.conf and
backup.exclude files. This script is advised to be run as a root owned cronjob.
backup.exclude files. This script is best run as a root owned cronjob.
Please see L<wre.conf.pod> for the backup options.
=head2 backup.exclude
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.
The script will ignore the test database, and any database that looks like it might
come from the demo system. The demo system databases are identified by any name that
starts with "demo" and then a digit, C<^demo\d>.
=over 4
Expand Down

0 comments on commit f040ef4

Please sign in to comment.