package b0
Module B0_rsyncSource
rsync support.
The type for rsync clients.
get ~search ~cmd () looks for the rsync command cmd (defaults to Cmd.tool "rsync") in search (defaults to Os.Cmd.get search).
Source
val copy :
t ->
?opts:B0_std.Cmd.t ->
?stats:bool ->
?progress:bool ->
delete:bool ->
?src_host:string ->
?dst_host:string ->
B0_std.Fpath.t ->
dst:B0_std.Fpath.t ->
(unit, string) resultcopy src ~dst copies the contents of directory src to dst with rsync. As per rsync semantics, directoryness of src is important and dst's one is not:
- If
srchas a trailing directory separator, the contentssrc/*is copied todst/*. - If
srchas no trailing directory separator, the contents ofsrc/*is copied todst/$(basename src)/*.
src_host and dst_host specify the host for source and destination directory (e.g. "myhost:"). They default to "". The rest of the arguments are:
- If
deleteistrue, deletes files at destination that do not exist insrcusing the--deleteflag. Defaults tofalse. - If
statsistrueoutputs statistics about the transfer using the--statsflag. Defaults tofalse. - If
progressistrue(default) outputs progress about the transfer using--info=progress2. optsare other options for rsync. It defaults to-azhwhich means transfer in archive mode which preserves symlinks and file attributes and compression is enabled.