diff --git a/src/im_mad/im_exec/one_im_exec.rb b/src/im_mad/im_exec/one_im_exec.rb index 8dfcc78b58..c10a97f0da 100755 --- a/src/im_mad/im_exec/one_im_exec.rb +++ b/src/im_mad/im_exec/one_im_exec.rb @@ -73,6 +73,17 @@ class InformationManagerDriver < OpenNebulaDriver if !action_is_local?(:MONITOR) if do_update == "1" || @options[:force_copy] + # Recreate dir for remote scripts + mkdir_cmd = "mkdir -p #{@remote_scripts_base_path}" + + cmd = SSHCommand.run(mkdir_cmd, host, log_method(number)) + + if cmd.code!=0 + send_message('MONITOR', RESULT[:failure], number, + 'Could not update remotes') + return + end + # Use SCP to sync: sync_cmd = "scp -r #{@local_scripts_base_path}/* " \ "#{host}:#{@remote_scripts_base_path}"