Scripting help!!
I'm struggling to understand scripting. I can do exactly what I want in the GUI but can't figure out how to script it all. I'm connecting to an SFTP server with a private key and synchronizing files remotely to a local copy. It works awesome in the GUI but I need to setup a script to run every hour. I have attached a screenshot of all the settings I'd like to have in the script. Could someone be so kind as to help me out or point me to a good example of everything I'm trying to do.
Needs:
1. Syntax for opening connection to SFTP server with PPK
2. Syntax for all the options as shown in the attached screenshot.
Here's what I started trying to piece together but I no clue if it's right.
WinSCP.com /command ^
"option batch abort" ^
"option transfer binary" ^
"option synchdelete on" ^
"option exclude "D:\inetpub\web\alert.xml;D:\inetpub\web\emergency.xml;D:\inetpub\web\.htaccess;D:\inetpub\web\notice.xml;D:\inetpub\web\sitemap.xml;D:\inetpub\web\web.config;D:\inetpub\web\wincache.php;D:\inetpub\web\fileshare\;D:\inetpub\web\xml-sitemap-generator\" ^
"open sftp://username@xxx.xxx.xxx.xxx/ /privatekey=C:\scripts\Puttygen\privkey.ppk" ^
"synchronize local d:\inetpub\web\ /web/" -preview ^
"close" ^
"quit" ^
/log="C:\scripts\WinSCP-5.9.1-Portable\t4log!Y_!M_!D_!T.log" /loglevel=0
[/img]
Needs:
1. Syntax for opening connection to SFTP server with PPK
2. Syntax for all the options as shown in the attached screenshot.
Here's what I started trying to piece together but I no clue if it's right.
WinSCP.com /command ^
"option batch abort" ^
"option transfer binary" ^
"option synchdelete on" ^
"option exclude "D:\inetpub\web\alert.xml;D:\inetpub\web\emergency.xml;D:\inetpub\web\.htaccess;D:\inetpub\web\notice.xml;D:\inetpub\web\sitemap.xml;D:\inetpub\web\web.config;D:\inetpub\web\wincache.php;D:\inetpub\web\fileshare\;D:\inetpub\web\xml-sitemap-generator\" ^
"open sftp://username@xxx.xxx.xxx.xxx/ /privatekey=C:\scripts\Puttygen\privkey.ppk" ^
"synchronize local d:\inetpub\web\ /web/" -preview ^
"close" ^
"quit" ^
/log="C:\scripts\WinSCP-5.9.1-Portable\t4log!Y_!M_!D_!T.log" /loglevel=0
[/img]