Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Synchronize files via sftp, error 127 (in gui over command line)

The first two scripts are wrong.
Explained here: https://winscp.net/eng/docs/faq_batch_file#cmd

The third does not have any synchronize command.
dziurexoo

Synchronize files via sftp, error 127 (in gui over command line)

Hi,
I try to automatic synchronize files from Windows to Linux via sftp.
I wrote simple winscp script:

# Connect to SFTP server using a password

winscp.com /ini=nul /script=test1.txt
open sftp://user:password@192.168.168.111 -hostkey="ssh-ed25519 256 xxxxxxxxxxxxxx=:
synchronize remote /root/pr C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup
# Exit WinSCP
exit

and i tried with:
# Connect to SFTP server using a password

winscp.com /ini=nul /script=test1.txt
option batch abort
option confirm off
open sftp://user:password@192.168.168.111 -hostkey="ssh-ed25519 256 xxxxxxxxxxxxxx=:
synchronize remote C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup  /root/pr
# Exit WinSCP
exit


and i used GUI to generate code:
open sftp://user:password@192.168.168.111/ -hostkey="ssh-ed25519 256 xxxxxxxxxxxxxxxxxxx="


lcd "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Backup"
cd /root/pr

put *
exit

and I have scp.txt with
 C:\Program Files (x86)\WinSCP\WinSCP.exe /log=C:\Program Files (x86)\WinSCP\WinSCP.log /ini=nul /script=C:\Program Files (x86)\WinSCP\scp.txt


And it doesn't work, maybe have i some mistake in script? In a backup folder i have files like example.bak