Copy by task manager (WIN) to (LIN) and "No Overwriting"

Advertisement

fernandosouza
Joined:
Posts:
1
Location:
Portugal

Copy by task manager (WIN) to (LIN) and "No Overwriting"

Hello everyone,

I need to copy the several big files WIN to LIN by WinSCP, but I need to no overwrite the files on the target host.
Ex of my CLI:
$PSNativeCommandArgumentPassing = "Legacy"
& "C:\Program Files (x86)\WinSCP\WinSCP.com" `
  /log="C:\Users\ADM-fsouza\Documents\script\WinSCP.log" /ini=nul `
  /command `
    "open sftp://root:Pl4DMr4f%285Flg0R%25fdo%24eo.Tg@sa72i085/ -hostkey=`"`"ssh-ed25519 255 15v8qt/geQzjV1XpbWjR0fcUJ2xVhUwrVrxVXwZjGtI`"`"" `
    "put R:\Backups\PA4_C3_APP_STD_05* /veeamxfsrepo/backups/PA4_C3_APP_STD_05" `
    "exit"
 
$winscpResult = $LastExitCode
if ($winscpResult -eq 0)
{
  Write-Host "Success"
}
else
{
  Write-Host "Error"
}
 
exit $winscpResult

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: Copy by task manager (WIN) to (LIN) and "No Overwriting"

Use synchronization instead:
synchronize remote -criteria=none -filemask=PA4_C3_APP_STD_05* R:\Backups /veeamxfsrepo/backups/PA4_C3_APP_STD_05
The -criteria=none makes it transfer nonexisting files only.

Reply with quote

Advertisement

You can post new topics in this forum