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: Put with switch "-append"

Thanks for letting us know!
magowoody

Re: Put with switch "-append"

Hi Martin,
I received confirmation that this flag is not currently supported in FileZilla Pro.
It will be added in the next release.
Thanks
magowoody

Re: Put with switch "-append"

Hi Martin,
I attach the new log with level 2.
In the meantime I will open a post in the FileZilla Pro Server forum.
martin

Re: Put with switch "-append"

I believe it's wrong SFTP implementation on the server. It probably ignores SSH_FXF_EXCL flag, and overwrites the existing target file. Consider contacting the server provider/author. If you want me check further, please post level 2 log.
magowoody

Re: Put with switch "-append"

Hi Martin,
Sorry! Here is the complete log file.
martin

Re: Put with switch "-append"

Complete log please.
magowoody

Re: Put with switch "-append"

Hi Martin,
This is the portion of the log affected with /loglevel=0
> 2024-12-30 09:25:11.704 Script: put -append -preservetime "timbacq.dat" "timbacq.dat"
. 2024-12-30 09:25:11.704 Copying 1 files/directories to remote directory "/in" - total size: 1.020
. 2024-12-30 09:25:11.704   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: timbacq.dat
. 2024-12-30 09:25:11.704   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; EncryptNewFiles: Yes; ExcludeHiddenFiles: No; ExcludeEmptyDirectories: No; InclM: ; ResumeL: 0
. 2024-12-30 09:25:11.704   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2024-12-30 09:25:11.710 File: 'timbacq.dat' [2024-12-27T09:54:41.227Z] [1020]
. 2024-12-30 09:25:11.710 Copying "timbacq.dat" to remote directory started.
. 2024-12-30 09:25:11.710 Binary transfer mode selected.
. 2024-12-30 09:25:11.710 Opening remote file.
martin

Re: Put with switch "-append"

At the very least, please post log on the Normal logging level.
Not the Reduced level: /loglevel=-1
magowoody

Re: Put with switch "-append"

> 2024-12-27 12:53:09.254 Script: put -append -preservetime "timbacq.dat" "timbacq.dat"
. 2024-12-27 12:53:09.254 Copying 1 files/directories to remote directory "/in" - total size: 840
. 2024-12-27 12:53:09.254 File: 'timbacq.dat' [2024-12-27T09:55:01.919Z] [840]
. 2024-12-27 12:53:09.254 Copying "timbacq.dat" to remote directory started.
. 2024-12-27 12:53:09.318 Preserving timestamp [2024-12-27T09:55:01.000Z]
. 2024-12-27 12:53:09.558 Transfer done: 'timbacq.dat' => '/in/timbacq.dat' [840]
. 2024-12-27 12:53:09.558 Copying finished: Transferred: 840, Elapsed: 0:00:00, CPS: 2.763/s

This is the affected portion of the log.
As you can see I also use the -preservetime parameter which however does not affect the problem.
I tried to remove it leaving only -append but there are no differences.
magowoody

Re: Put with switch "-append"

@martin: Hi,
I attach the log file as you asked.
I downloaded the latest version but it doesn't run -append.
Max
martin

Re: Put with switch "-append"

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
magowoody

Put with switch "-append"

Hi.
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

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 -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