mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
REFACTOR: Restoring of backups and migration of uploads to S3
This commit is contained in:
@ -100,6 +100,16 @@ module FileStore
|
||||
list_missing(OptimizedImage) unless skip_optimized
|
||||
end
|
||||
|
||||
def copy_from(source_path)
|
||||
FileUtils.mkdir_p(File.join(public_dir, upload_path))
|
||||
|
||||
Discourse::Utils.execute_command(
|
||||
'rsync', '-a', '--safe-links', "#{source_path}/", "#{upload_path}/",
|
||||
failure_message: "Failed to copy uploads.",
|
||||
chdir: public_dir
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def list_missing(model)
|
||||
|
Reference in New Issue
Block a user