PSCP is a command line secure file copy program. It’s part of the PuTTY suite of files, which also includes PuTTY – a Telnet and SSH client.
Within the PuTTY suite is another program called : Plink – which is a command line interface to the PuTTY backend. The great thing about Plink is it can be used as part of a script for management of DB2 servers. For example, a script to log on securely to a server – run a series of commands. One of the limitation of Plink is you can’t download files. At this point PSCP is called in to play
An example of a command line of PSCP in a Powershell script on Windows. In this example, the username, password and servername are passed to the command line. PSCP logs on to the server and downloads the files onto the local server. In this case , we’re downloading all files with a prefix “db2diag” on the folder “\servername\tmp\” onto the local server path “E:\DB2\logs”. Contact me for any assistance
$un = “myName” $pw = “myPW” $servername = “myServerName” E:\scripts\DB2\modules\pscp.exe -l $un -pw $pw -p $un@$($servername):/tmp/db2diag* E:\DB2\logs\