WinSCP SCP requirements

Advertisement

Madoway
Guest

WinSCP SCP requirements

I have a script that does the job (updates two files, sets execute rights and runs a shell script successfully), but still WinSCP returns error (code 1):

winscp.com /command "option batch continue" "option confirm off"
"open scp://user:password@10.0.0.10:22 -timeout=3600 -hostkey="*""
"put -speed=5 -resumesupport=on C:\tmp\update.tgz /tmp/update.tgz"
"put -speed=5 -resumesupport=on C:\tmp\deploy.sh /tmp/deploy.sh"
"chmod 755 /tmp/deploy.sh" "call /tmp/deploy.sh" "exit"

If I enable logging I can see that WinSCP tries to run e.g. groups command, which is not found in my target. The WinSCP SCP requirements (https://winscp.net/eng/docs/requirements#scp) state that WinSCP wants to run commands cd, chgrp, chmod, chown, echo, groups, ls, mkdir, mv, pwd, scp, rm, ln, unalias and unset. How do I make WinSCP to ignore the errors caused by the failure to run these commands?

Or can I make some kind of a workaround? Would I be able to get e.g. the return code of the script that I call with "call /tmp/deploy.sh"?

Reply with quote

Advertisement

Madoway
Guest

Solved

This may not solve the issue in general, but when I unchecked the setting "Lookup user groups" (Select SCP as File protocol and then in Advanced -> Environment -> SCP/Shell -> Other options) and saved it as a global default (Save -> Set Defaults), it no longer uses the groups command and luckily that was the only one missing from my target environment.

I have run WinSCP in two PCs, both running the exact same version (5.5.1 build 3970) and both with default parameters. On the other PC I did not have to uncheck the groups option to get it working but on the other I had to. I guess when the option is not set, WinSCP uses some logic to try to determine the correct setting.

Reply with quote

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

Re: Solved

Madoway wrote:

This may not solve the issue in general, but when I unchecked the setting "Lookup user groups" (Select SCP as File protocol and then in Advanced -> Environment -> SCP/Shell -> Other options) and saved it as a global default (Save -> Set Defaults), it no longer uses the groups command and luckily that was the only one missing from my target environment.
To set the option in script see:
https://winscp.net/eng/docs/rawsettings

Reply with quote

Advertisement

You can post new topics in this forum