Topic "SFTP-Error listing directory -> No such file or directory -> Error Code 2"

Author Message
ZAJDAN
[View user's profile]

Joined: 2017-06-06
Posts: 2
Location: CzechRepublic
Hello
I have windows scheduler script for winSCP:
Code:
/log=c:\Users\Administrator\winscp.log /command "open sftp://sqlbackup:mypassword@192.168.6.116/" "synchronize remote C:\database_backups  /mnt/databox/sapDatabase-backup/sqlbackup" "exit"


but in log I see this problem:
Code:
2017-06-06 14:35:12.333 Error listing directory '/mnt/databox/sapDatabase-backup/sqlbackup'. ("No such file or directory.
. 2017-06-06 14:35:12.333 Error code: 2
. 2017-06-06 14:35:12.333 Error message from server: No such file")
< 2017-06-06 14:35:12.334 Script: Error listing directory '/mnt/databox/sapDatabase-backup/sqlbackup'.
< 2017-06-06 14:35:12.334 Script: No such file or directory.
< 2017-06-06 14:35:12.334 Error code: 2
< 2017-06-06 14:35:12.334 Error message from server: No such file
. 2017-06-06 14:35:12.334 Script: Failed
. 2017-06-06 14:35:12.334 Script: Exit code: 1
. 2017-06-06 14:35:12.335 Closing connection.
. 2017-06-06 14:35:12.335 Sending special code: 12
. 2017-06-06 14:35:12.335 Sent EOF message


when I connect to the directory via GUI, so I am successfully connected and can create/delete files/directory

on linux the user sqlbackup is chrooted and has shell /bin/false

on server in auth.log is:
Code:
systemd-logind[712]: New session 37 of user sqlbackup.
systemd: pam_unix(systemd-user:session): session opened for user sqlbackup by (uid=0)
linux-zdenek sshd[16519]: pam_unix(sshd:session): session closed for user sqlbackup
linux-zdenek systemd-logind[712]: Removed session 37.
linux-zdenek systemd: pam_unix(systemd-user:session): session closed for user sqlbackup


Thank You for any hint
Regards ZAJDAN
ZAJDAN
[View user's profile]

Joined: 2017-06-06
Posts: 2
Location: CzechRepublic
SOLVED...
because I use chroot via sshd_config I can not use the whole path but only what is inside the chroot...so in my case
/log=c:\Users\Administrator\winscp.log /command "open sftp://sqlbackup:mypassword@192.168.6.116/" "synchronize remote C:\database_backups /sqlbackup" "exit"

thanx for Tuxik(CZ) :_)
Advertisements

You can post new topics in this forum

Search

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