Bug #3672: Set fixed backup file names

(cherry picked from commit a19db61833)
This commit is contained in:
Carlos Martín committed 2015-03-11 16:18:36 +01:00
1 parent f1c922eb95
commit 089df28333
1 file changed
+7 -4
+7 -4
View File
@@ -69,8 +69,6 @@ class OneDB
end
def backup(bck_file, ops, backend=@backend)
bck_file = backend.bck_file if bck_file.nil?
if !ops[:force] && File.exists?(bck_file)
raise "File #{bck_file} exists, backup aborted. Use -f " <<
"to overwrite."
@@ -81,8 +79,6 @@ class OneDB
end
def restore(bck_file, ops, backend=@backend)
bck_file = backend.bck_file if bck_file.nil?
if !File.exists?(bck_file)
raise "File #{bck_file} doesn't exist, backup restoration aborted."
end
@@ -143,6 +139,8 @@ class OneDB
puts ""
end
ops[:backup] = @backend.bck_file if ops[:backup].nil?
backup(ops[:backup], ops)
begin
@@ -265,6 +263,8 @@ class OneDB
@backend.check_db_version()
ops[:backup] = @backend.bck_file if ops[:backup].nil?
# FSCK will be executed, make DB backup
backup(ops[:backup], ops)
@@ -409,6 +409,9 @@ is preserved.
merge_vdcs = input == "Y"
ops[:backup] = @backend.bck_file if ops[:backup].nil?
ops[:"slave-backup"] = slave_backend.bck_file if ops[:"slave-backup"].nil?
# Import will be executed, make DB backup
backup(ops[:backup], ops)
backup(ops[:"slave-backup"], ops, slave_backend)