Topic "How do you limit the number of files to be transferred over"

Author Message
SrpskiZmaj

Guest


I need help. I have requirements that no more then 5 .xml files can be transferred at a time. Script runs every 10 minutes.
So in case I will get 100 .xml files I would like my script to send 5 files. Then after 10 minutes again 5 files etc.


I appreciate for your help.

SrpskiZmaj
Advertisements
SrpskiZmaj

Guest


Here is my current:

open XXXXXXX:YYYYYYYYY@ZZZZZZZZZZ

option batch abort
option transfer ascii
option confirm off

cd MFT_GIBRALTAR_I2029_MS
put C:\sFTP-GiB_to_MS-XB60\sFTP-GiB_to_MS-XB60_QA\GIB_I2029\*.xml

close

exit



SrpskiZmaj wrote:
I need help. I have requirements that no more then 5 .xml files can be transferred at a time. Script runs every 10 minutes.
So in case I will get 100 .xml files I would like my script to send 5 files. Then after 10 minutes again 5 files etc.


I appreciate for your help.

SrpskiZmaj
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
You cannot do this with a simple WinSCP scripting.

You have to use some advanced scripting language (e.g. PowerShell) to select the 5 files and make WinSCP transfer them.
_________________
Martin Prikryl
SrpskiZmaj

Guest


prikryl wrote:
You cannot do this with a simple WinSCP scripting.

You have to use some advanced scripting language (e.g. PowerShell) to select the 5 files and make WinSCP transfer them.



Can I use command "put C:\sFTP-GiB_to_MS-XB60\sFTP-GiB_to_MS-XB60_QA\GIB_I2029\*.xml "<1D but instead of days put minutes?
Is there any wait command between another command. For example:

Put *.xml<10min
wait 10min
Put *.xml<20min
wait 10min
Put *.xm<30min
and so on

This would also work for me.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Yes, use N suffix for minutes, like *.xml<10N.
See https://winscp.net/eng/docs/file_mask
But I do not see a point of your code.
Doing *.xml<20min 10 minutes after *.xml<10min will select the same files (10+10=20).
_________________
Martin Prikryl
SrpskiZmaj

Guest


prikryl wrote:
Yes, use N suffix for minutes, like *.xml<10N.
See https://winscp.net/eng/docs/file_mask
But I do not see a point of your code.
Doing *.xml<20min 10 minutes after *.xml<10min will select the same files (10+10=20).


Ok fair enough.... It would work better if it is put *.xml>30min, then *.xml>20min then *.xml>10min.
so If I have 50 accumulated .xml files and they have been created not in the same time lets say 3 every 10 minutes. I can send them all by setting script from 2hours, 1.50min, 1.40min etc.
Is there a wait command available?

What about something like that:

put 0min<*xml<10min
put 10min<*.xml<20min
put 20min<*.xml<30min
put 30min<*.xml<40min
........
........
put *xml


Is this possible?


SrpskiZmaj


SrpskiZmaj
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
SrpskiZmaj wrote:
What about something like that:

put 0min<*xml<10min
put 10min<*.xml<20min
put 20min<*.xml<30min
put 30min<*.xml<40min

Yes.

put *.xml>10N
put *.xml<=10N>20N
put *.xml<=20N>30N
put *.xml<=30N>40N
put *.xml<=40N

Again, see https://winscp.net/eng/docs/file_mask
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License