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

Advertisement

SrpskiZmaj
Guest

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

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

Reply with quote

Advertisement

SrpskiZmaj
Guest

Re: How do you limit the number of files to be transferred over

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

Reply with quote

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

Re: How do you limit the number of files to be transferred over

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.

Reply with quote

SrpskiZmaj
Guest

Re: How do you limit the number of files to be transferred over

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

Reply with quote

Advertisement

SrpskiZmaj
Guest

Re: How do you limit the number of files to be transferred over

martin 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

Reply with quote

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

Re: How do you limit the number of files to be transferred over

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

Reply with quote

edge
Guest

how to set a time span for transfer

hi
I need help on how to set a time span for my transfer of files like 1000h-1200h only.
appreciate your help :)

Reply with quote

Advertisement

You can post new topics in this forum