Property SkipUnchanged
SkipUnchanged
In UploadDirectoryAsync(string, string, SftpTransferOptions?, CancellationToken) and DownloadDirectoryAsync(string, string, SftpTransferOptions?, CancellationToken), leave a file alone when the destination already has a regular file of that name with the same size and modification time, as rsync's quick check does (default false). The single-file methods ignore it.
public bool SkipUnchanged { get; init; }
Property Value
Remarks
The modification times are compared to the second: SFTP version 3 carries whole seconds, so the local time's fraction is dropped first. A time or size the server does not send counts as a difference, and the file is transferred. It is not a check of the contents: a file changed without changing its size, whose time was then set back (or that was changed within the same second), is taken as unchanged. On a file system that keeps coarser times (FAT's 2 seconds, some SMB shares) the times may never match, and every file is transferred, as without this option, unless TimeTolerance allows for the difference.
The times only match when the earlier transfer copied them: set Preserve on every transfer of the tree, otherwise each copy carries the time it was written, and every file is transferred again. Files left alone are counted in Unchanged, report no Progress, and keep their attributes as they are.
A download compares with the local files, at no extra cost: the remote sizes and times come from the listings. An upload lists each remote directory that already existed once, when its first file is reached (a directory the transfer creates holds nothing to compare with), and compares with the listing. Against ProFTPD's mod_sftp, which answers OK to creating a directory that is there already, it lists every remote directory it goes into.