mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
Bug #3672: Set fixed backup file names
(cherry picked from commit a19db618332a311ba34639c5664bb7b08621fff4)
This commit is contained in:
parent
f1c922eb95
commit
089df28333
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user