code: def sync_path_to_host(path, host, user, verbose=False, cmd=None, gid=None,
                        fatal=False):
      
      cmd = cmd or copy(BASE_CMD)
      if not verbose:
          cmd.append('-silent')
  
      # removing trailing slash from directory paths, unison
      # doesn't like these.
      if path.endswith('/'):
          path = path[:(len(path) - 1)]
  
      cmd = cmd + [path, 'ssh://%s@%s/%s' % (user, host, path)]
  
      try:
          log('Syncing local path %s to %s@%s:%s' % (path, user, host, path))
          run_as_user(user, cmd, gid)
      except Exception:
          log('Error syncing remote files')
          if fatal:
              raise
docs: Sync path to an specific peer host
  
      Propagates exception if operation fails and fatal=True.