Commit fbc4695d authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Testing a theory about NFS ... lets rename the dbdump file instead of

overwriting in place.
parent e985ba62
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005, 2006 University of Utah and the Flux Group.
# Copyright (c) 2005, 2006, 2007 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -469,6 +469,14 @@ sub DumpDB(@)
return -1;
}
#
# For NFS, lets not overwrite the samefile, but *create* a new one.
#
if (-e $filename) {
system("/bin/mv $filename ${filename}.old") == 0 or
fatal("Could not mv $filename");
}
open(DUMP, "| $MYSQLDUMP -u root -p -a -e $dbname | $GZIP > $filename") or
fatal("Could not start $MYSQLDUMP!");
print DUMP "$dbpass\n";
......@@ -476,6 +484,9 @@ sub DumpDB(@)
fatal($! ? "Error closing $MYSQLDUMP pipe: $!"
: "Exit status $? from $MYSQLDUMP");
unlink("${filename}.old")
if (-e "${filename}.old");
return 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment