def rsync_files(src, dst, args, logger=None, quiet=True):
 if (args is None):
  args = ''
 RSYNC_CMD = ("rsync -a %%s '%%s' %%s %s --exclude-from=/etc/cobbler/rsync.exclude" % args)
 if quiet:
  RSYNC_CMD += ' --quiet'
 else:
  RSYNC_CMD += ' --progress'
 if (not dst.endswith('/')):
  dst = ('%s/' % dst)
 if (not src.endswith('/')):
  src = ('%s/' % src)
 spacer = ''
 if ((not src.startswith('rsync://')) and (not src.startswith('/'))):
  spacer = ' -e "ssh" '
 rsync_cmd = (RSYNC_CMD % (spacer, src, dst))
 try:
  res = subprocess_call(logger, rsync_cmd)
  if (res != 0):
   die(logger, ("Failed to run the rsync command: '%s'" % rsync_cmd))
 except:
  return False
 return True

def rsync_files ( src , dst , args , logger = None , quiet = True ) : if ( args is None ) : args = '' RSYNC_CMD = ( "rsync -a %%s '%%s' %%s %s --exclude-from=/etc/cobbler/rsync.exclude" % args ) if quiet : RSYNC_CMD += ' --quiet' else : RSYNC_CMD += ' --progress' if ( not dst . endswith ( '/' ) ) : dst = ( '%s/' % dst ) if ( not src . endswith ( '/' ) ) : src = ( '%s/' % src ) spacer = '' if ( ( not src . startswith ( 'rsync://' ) ) and ( not src . startswith ( '/' ) ) ) : spacer = ' -e "ssh" ' rsync_cmd = ( RSYNC_CMD % ( spacer , src , dst ) ) try : res = subprocess_call ( logger , rsync_cmd ) if ( res != 0 ) : die ( logger , ( "Failed to run the rsync command: '%s'" % rsync_cmd ) ) except : return False return True
sync files from src to dst .