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: stuck on synchronize command, plus want to do more...

It looks mostly good. Except that there's no -neweronly switch to the synchronize command. If you want to synchronize only newer files, remove also -mirror, as that does the opposite (transfers even older files => all different files). Though that conflicts with checksum. So it looks like you actually do not want to synchronize only newer files, and you actually want the mirror mode.

Put your desired -criteria=time,size,checksum (no brackets, no spaces) on the same place, where -mirror -neweronly is.

Note that simple scripting does not support concurrent transfers. For that see:
Automating transfers or synchronization in parallel connections over SFTP/FTP protocol
Apophis

Stuck on synchronize command, plus want to do more...

So I (and ChatGTP) wrote this little script file but not sure if it is working, and I know it does not do everything I want yet. ChatGTP helped on it and I think it is wrong.
What I would like to do is for it to compare what I have on my local drive with what is on the site, if I do not have what is on the site, DL it. I'm only interested in DLing files, not uploading. Optimally I would like to check for criteria check so I think I need to add -criteria=<time, size, checksum> but not sure where. On the main app I have it set to 2 concurrent transfers, but if I change that, this changed. I would like for bat file run to stay that way with 2 concurrent transfers.

Also, any advantage to changing any of the other parameters? The files are going to be 20MB to 20GB.

Script file:
open Skyrem_Edu
option batch on
option confirm off
option log "C:\Program Files (x86)\WinSCP\LogFile\winscp_log.txt"
 
synchronize local "X:\Files\V\S" "/files/V/S" -mirror -neweronly
 
close
exit

Bat file:
@echo off
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script="X:\Files\V\Educational\SFTP_Educational_sync_script.txt"