feature #2468: add rsync option to onehost sync

This commit is contained in:
Javi Fontan committed 2013-11-26 18:35:55 +01:00
1 parent b62925196f
commit 81b045de86
2 files changed
+17 -2

No files matched your search

+8 -1
View File
@@ -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
View File
@@ -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