Wait for file being stable before transferring

Advertisement

myriad_rocker
Guest

Wait for file being stable before transferring

I've made a script that works great for transferring files from Windows to Unix. Files are downloaded via another tool and then I have a scheduled task that runs every three minutes to move the files via the script. However, I'm concerned that WinSCP will try to transfer the file before it has completed downloading.

So, is there a parameter or switch that I can use to make sure the file is stable before it gets transferred? In other words, just skip the file if it's not stable. Just wait until next time.

Reply with quote

Advertisement

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

Re: Wait for file being stable before transferring

Cannot you schedule both tasks in sequence, so you are sure thay do not overlap?
Or make you tool download the files to temporary location and than quickly move them to the place, where WinsCP picks them.

Reply with quote

myriad_rocker
Guest

Re: Wait for file being stable before transferring

martin wrote:

Cannot you schedule both tasks in sequence, so you are sure thay do not overlap?
Or make you tool download the files to temporary location and than quickly move them to the place, where WinsCP picks them.
The download tool is a continuous Windows service. It is also a corporate solution, so where it downloads is where I have to pull it from. I just want to make sure the file has not been written to or "touched" in the last minute or so. Can I not do that?

Reply with quote

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

Re: Wait for file being stable before transferring

myriad_rocker wrote:

The download tool is a continuous Windows service. It is also a corporate solution, so where it downloads is where I have to pull it from. I just want to make sure the file has not been written to or "touched" in the last minute or so. Can I not do that?
Not directly with WinSCP. But you can write a wrapper script that would check the file timestamp before running WinSCP script.

Reply with quote

Advertisement

You can post new topics in this forum