Put with switch "-append"
Hi.
I can't use the
My goal is to add the content of the text file I'm sending when it is already present in the destination server.
I'm using the SFTP protocol with public key access and private key with "passphrase".
This is the relevant part of my .BAT script:
The file is sent correctly but on the server the file is always overwritten.
At the moment I solved it by importing the file from the server and then merging it with the one to be sent on the client side, but I would be interested in understanding how to use the
I hope someone can help me.
Max
I can't use the
-append
switch connected to the put
operator inside a script.
My goal is to add the content of the text file I'm sending when it is already present in the destination server.
I'm using the SFTP protocol with public key access and private key with "passphrase".
This is the relevant part of my .BAT script:
rem Generate temporary script ( echo open sftp://<user>@<url-sftp> -privatekey=%_pathKey%\<file>.ppk -hostkey="<privatekey>" -passphrase="<passphrase>" echo lcd <localpath> echo cd <remotepath> echo put -append -preservetime "<file>" <file>" echo put -nopreservetime "<file_fake_last_connection>" "<file_fake_last_connection>" echo exit ) > script.tmp rem Run temporary script %_path%\winscp.com /ini=nul /log=%_path%\log\<file_log.log> /logsize=5*1M /loglevel=-1 /script=script.tmp
At the moment I solved it by importing the file from the server and then merging it with the one to be sent on the client side, but I would be interested in understanding how to use the
-append
switch with the put
command as per the documentation https://winscp.net/eng/docs/scriptcommand_put and https://winscp.net/eng/docs/scriptcommand_put#append.
I hope someone can help me.
Max