Topic "WinSCP SCP requirements"

Author Message
Madoway

Guest


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):

Code:
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"?
Madoway

Guest


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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License