checksum

Calculates a checksum of a remote file.

Syntax

checksum <alg> <file>

Remarks

alg is a name of a checksum algorithm to use. Use IANA name of algorithm or use a name of any proprietary algorithm the server supports (with SFTP protocol only). Commonly supported algorithms are sha-1 and md5.

Advertisements:

Supported with SFTP and FTP protocols, subject to support of respective protocol extension.

XML log element: checksum

Examples

checksum sha-1 index.html

Converting to .NET Assembly

When converting script to .NET Assembly, map checksum command to Session.CalculateFileChecksum method.

Parameters mapping: Command parameters alg and file maps to method parameters algorithm and path, respectively. You have to convert relative paths to absolute paths.

For example, the following script snippet:

cd /home/martinp/public_html
checksum sha-1 index.html

maps to the following PowerShell code:

Write-Host ([System.BitConverter]::ToString($session.CalculateFileChecksum("/home/martinp/public_html/index.html")))
 
  scriptcommand_checksum.txt · Last modified: by martin
 

Search Documentation

This page

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

Associations

Site design by Black Gate