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: script update

What do you mean by "pull"? It is typically used for download, while you are seem to be trying to upload the latest file. Actually, why are you first downloading and then uploading? Is that intentional? Anyway, if you have problems, please attach a full session log file showing it (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.
Guest

script update

Alright, thank you for the resource! I referenced it but my script is still not working. It seems to be still pulling all of the files from the source.

Here is what I have now:
option batch off
option confirm off
open [folder:email directory]
option transfer binary cd /x/y lcd "C:\Shares\Data\W\X\Y"
get -preservetime *.csv
put -latest c:\Shares\Data\W\X\* #tried this first but commented it out because it did not work
put -filemask="*>=today" c:\Shares\Data\W\X\*
Disconnect
close
exit

What I feel like I am missing is a correct line for it to update daily and avoid repeated files. I tried to do this with the two put commands but it did not work – it just pulls everything from the source.
person

Upload new and modified files using FTP

Hi there, I am new to WinSCP and I was wondering if someone would be able to look at this script and let me know how I could change this to make sure only new/changed files are going through FTP.
option batch off
option confirm off
open [folder:email directory]
option transfer binary
cd /x/y
lcd "C:\Shares\Data\W\X\Y"
get -preservetime *.csv
 
Disconnect
close
exit