Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
a407c995
Commit
a407c995
authored
Apr 11, 2008
by
Leigh B. Stoller
Browse files
Set web banner to message during backup operation so that people know
why the system is sluggish.
parent
dc967daf
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/backup.in
View file @
a407c995
...
...
@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
3, 2006
University of Utah and the Flux Group.
# Copyright (c) 2000-200
8
University of Utah and the Flux Group.
# All rights reserved.
#
use
English
;
...
...
@@ -33,6 +33,7 @@ my $BACKUPDIR = "$TB/backup";
my
$LOGDIR
=
"
$TB
/log/mysql
";
my
$HOTCOPY
=
"
/usr/local/bin/mysqlhotcopy
";
my
$MYSQLDUMP
=
"
/usr/local/bin/mysqldump
";
my
$SETSITEVAR
=
"
$TB
/sbin/setsitevar
";
my
$TAR
=
"
/usr/bin/tar
";
my
$BASE
=
"
base
";
my
$UPD
=
"
update
";
...
...
@@ -92,6 +93,12 @@ if (! chdir($BACKUPDIR)) {
fatal
("
Could not chdir to
$BACKUPDIR
: $!
");
}
#
# Let people know the system will be sluggish.
#
system
("
$SETSITEVAR
web/message '<font color=red>
"
.
"
Nightly backup in progress; system might be sluggish</font>'
");
#
# Open up the index file to see what the current update file extension is.
# The base/backup files correspond to this most recent update file, and
...
...
@@ -219,6 +226,7 @@ if ($dohotcopy && -e "$BACKUPDIR/tbdb") {
#SENDMAIL("stoller@flux.utah.edu",
# "DB Backup Finished", "", undef, undef, ($logname));
system
("
$SETSITEVAR
web/message -
");
unlink
("
$logname
");
exit
0
;
...
...
@@ -228,6 +236,7 @@ sub fatal($) {
print
STDERR
"
$msg
\n
";
SENDMAIL
(
$TBOPS
,
"
DB Backup Failed
",
$msg
,
undef
,
undef
,
(
$logname
));
system
("
$SETSITEVAR
web/message -
");
unlink
("
$logname
");
exit
(
1
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment