FIX: Make sure constant reflects the right backup extenstion.
This commit is contained in:
parent
2cb4cb7b72
commit
3e4b02bbd4
|
@ -7,7 +7,8 @@ module BackupRestore
|
||||||
class OperationRunningError < RuntimeError; end
|
class OperationRunningError < RuntimeError; end
|
||||||
|
|
||||||
VERSION_PREFIX = "v".freeze
|
VERSION_PREFIX = "v".freeze
|
||||||
DUMP_FILE = "dump.sql"
|
DUMP_FILE = "dump.sql.gz".freeze
|
||||||
|
OLD_DUMP_FILE = "dump.sql".freeze
|
||||||
METADATA_FILE = "meta.json"
|
METADATA_FILE = "meta.json"
|
||||||
LOGS_CHANNEL = "/admin/backups/logs"
|
LOGS_CHANNEL = "/admin/backups/logs"
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ module BackupRestore
|
||||||
@current_db = RailsMultisite::ConnectionManagement.current_db
|
@current_db = RailsMultisite::ConnectionManagement.current_db
|
||||||
@timestamp = Time.now.strftime("%Y-%m-%d-%H%M%S")
|
@timestamp = Time.now.strftime("%Y-%m-%d-%H%M%S")
|
||||||
@tmp_directory = File.join(Rails.root, "tmp", "backups", @current_db, @timestamp)
|
@tmp_directory = File.join(Rails.root, "tmp", "backups", @current_db, @timestamp)
|
||||||
@dump_filename = "#{File.join(@tmp_directory, BackupRestore::DUMP_FILE)}.gz"
|
@dump_filename = File.join(@tmp_directory, BackupRestore::DUMP_FILE)
|
||||||
@archive_directory = File.join(Rails.root, "public", "backups", @current_db)
|
@archive_directory = File.join(Rails.root, "public", "backups", @current_db)
|
||||||
@archive_basename = File.join(@archive_directory, "#{SiteSetting.title.parameterize}-#{@timestamp}-#{BackupRestore::VERSION_PREFIX}#{BackupRestore.current_version}")
|
@archive_basename = File.join(@archive_directory, "#{SiteSetting.title.parameterize}-#{@timestamp}-#{BackupRestore::VERSION_PREFIX}#{BackupRestore.current_version}")
|
||||||
|
|
||||||
|
|
|
@ -115,10 +115,10 @@ module BackupRestore
|
||||||
# For backwards compatibility
|
# For backwards compatibility
|
||||||
@dump_filename =
|
@dump_filename =
|
||||||
if @is_archive
|
if @is_archive
|
||||||
if system("tar --list --file #{@source_filename} #{BackupRestore::DUMP_FILE}")
|
if system("tar --list --file #{@source_filename} #{BackupRestore::OLD_DUMP_FILE}")
|
||||||
File.join(@tmp_directory, BackupRestore::DUMP_FILE)
|
File.join(@tmp_directory, BackupRestore::OLD_DUMP_FILE)
|
||||||
else
|
else
|
||||||
File.join(@tmp_directory, "#{BackupRestore::DUMP_FILE}.gz")
|
File.join(@tmp_directory, BackupRestore::DUMP_FILE)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
File.join(@tmp_directory, @filename)
|
File.join(@tmp_directory, @filename)
|
||||||
|
|
Loading…
Reference in New Issue