mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-15 17:23:10 +09:00
feature #2468: add rsync option to onehost sync
This commit is contained in:
1 parent
b62925196f
commit
81b045de86
2 files changed
+17
-2
No files matched your search
@@ -253,7 +253,14 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
|
||||
|
||||
print_update_info(total-size, total, host['NAME'])
|
||||
|
||||
sync_cmd = "scp -rp #{REMOTES_LOCATION}/. #{host['NAME']}:#{remote_dir} 2> /dev/null"
|
||||
if options[:rsync]
|
||||
sync_cmd = "rsync -Laz --delete #{REMOTES_LOCATION}" <<
|
||||
" #{host['NAME']}:#{remote_dir}"
|
||||
else
|
||||
sync_cmd = "scp -rp #{REMOTES_LOCATION}/. " <<
|
||||
"#{host['NAME']}:#{remote_dir} 2> /dev/null"
|
||||
end
|
||||
|
||||
`#{sync_cmd} 2>/dev/null`
|
||||
|
||||
if !$?.success?
|
||||
|
||||
+9
-1
@@ -79,8 +79,16 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
:description => "Force probe upgrade in onehost sync"
|
||||
}
|
||||
|
||||
RSYNC = {
|
||||
:name => "rsync",
|
||||
:large => "--rsync" ,
|
||||
:description => "Use rsync to synchronize remotes. In case some " <<
|
||||
"probes are no longer in the fronted are deleted in the hosts." <<
|
||||
" rsync command must be installed in the frontend and nodes."
|
||||
}
|
||||
|
||||
CREAT_OPTIONS = [ IM, VMM, VNET, OneClusterHelper::CLUSTER ]
|
||||
SYNC_OPTIONS = [ OneClusterHelper::CLUSTER, FORCE ]
|
||||
SYNC_OPTIONS = [ OneClusterHelper::CLUSTER, FORCE, RSYNC ]
|
||||
|
||||
########################################################################
|
||||
# Formatters for arguments
|
||||
|
||||
Reference in new issue
Block a user