Writing a scripts to send new files since last session

Advertisement

Vee87
Joined:
Posts:
2
Location:
Dublin

Writing a scripts to send new files since last session

I am looking to create a batch file for running a scheduled transfer using WinSCP 3 times a day.

The time I want to run are 1pm, 6pm and 9.30pm.

My initial idea was to have the script scan the folder and transfer anything older than 5 hours..
Script I have is this (from commands):
    "open ftp://USER:PASS1@123.123.123.123/" ^
    "lcd C:\Users\TEST\TEST" ^
    "put *.CSV<5HS" ^
I keep getting error – access denied, cannot copy file etc. I have tried a space between the *.CSV and the time operator, tried it with and without extra quotation marks but I'm not getting anywhere.

It will work without the time constraints no problem.

I was trying to find an answer on the KBs but no avail.

I've also seen the following guide on Remembering the last timestamp which would be really appealing if I could get it to work but it's beyond me at the moment!
How do I transfer new/modified files only?

Any help would be greatly appreciated.

Thanks,
Vee

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,773
Location:
Prague, Czechia

Re: Writing a scripts to send new files since last session

What version of WinSCP are you using?
Are you aware that the S suffix is supported by the latest beta version of WinSCP only?

Reply with quote

Vee87
Joined:
Posts:
2
Location:
Dublin

Hi Martin,

I'm using 5.14.4RC.

I have removed the S and still getting errors. Am I right in using it this way?
"put "*.csv" <H"  ^
Thanks

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,773
Location:
Prague, Czechia

No. Just remove the S from your code. This is correct:
"put *.CSV<5H" ^
If it does not help, we need to see a session log file.

Reply with quote

shaileshjs1@...
Guest

Access Deny Error

Check with recipient infrastructure team. They might have not given write permission.

Reply with quote

Advertisement

You can post new topics in this forum