Issue
I want my WinSCP script to loop.
Starting script (.bat file)
winscp.com /script=SyncToRemoteScript.txt
pause
My script (.txt file)
open ftp://usernam:password@myhost/ -hostkey="ssh-ed25XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="
put D:\folder /home/myuser/public_html/wp-content/themes/newtheme
exit
I tried GOTO method like this – not working.
:start
open ftp://usernam:password@myhost/ -hostkey="ssh-ed25XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="
put D:\folder /home/myuser/public_html/wp-content/themes/newtheme
goto start
Tried while also, but CMD tells me "Unknown command 'While'". I googled that problem can solved by saving the file ASCII, but it's not working either.
Solution
There's no goto command in WinSCP.
But there's goto command in Windows batch file, so you can do:
:start
winscp.com /script=SyncToRemoteScript.txt
goto start
For a bit more complex code, see WinSCP Retrying Script example.
Though as you seem to try to continuously update a remote directory, consider using:
synchronize remotecommand to update only modified files.keepuptodatecommand to continuously update modified files (and you won't need any loop).
Answered By - Martin Prikryl Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.