Upload new and modified files using FTP

Advertisement

person
Guest

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

Reply with quote

Advertisement

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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

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.

Reply with quote

Advertisement

You can post new topics in this forum