Topic "Automating file upload and download with reliability."

Author Message
Prime

Guest


Hi all.

I've been trying to write scripts to automate the upload and download of files from a remote server.

Sometimes it works ... sometimes it doesn't ... regardless, the expected errorlevel never indicates anything other than a successful result.

I want to take the script to the next level (delete remote files after successful download) but clearly this is dangerous if the downlaod failed.

Is there any more information about errorlevels and or ways of guaranteeing success?

TIA

Prime
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
First, please describe me the scenario where you have the problems.

Prime wrote:
I want to take the script to the next level (delete remote files after successful download) but clearly this is dangerous if the downlaod failed.

Have you tried using "option batch abort"?
_________________
Martin Prikryl
Guest




Hi, and thanks for the reply ...

Following is a snippet from the activity log ...
<-----Snippet starts here----->
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] username@remote.server.com
transfer binary
y:\!Uploads_To_Remote
username:/Local to Remote
local_filename.zip | 0 kB | 0.0 kB/s | binary | 0%
Host has not answered for 15 seconds.
Wait for another 15 seconds? Pressing 'Abort' button will close session.
(A)bort, (R)etry: Abort
Copying files to remote side failed.
Terminated by user.
Session 'username@remote.server.com' closed.
No session.
No session.
FILES SUCCESSFULLY DOWNLOADED!

Y:\!Uploads_To_Remote\local_filename.zip
1 file(s) copied.
<-----Snippet ends here----->

Now, this script is called by a batch file which checks for returning errorlevel value.
As you can see, the session failed however the "FILES SUCCESSFULLY DOWNLOADED!" prompt still appears indicating a successful transfer.

I also have a second script that is used to download files from the remote but it suffers from similar reliability issues. I want to be able to delete files off the remote after a successful xfer.

Any ideas?


prikryl wrote:
First, please describe me the scenario where you have the problems.

Prime wrote:
I want to take the script to the next level (delete remote files after successful download) but clearly this is dangerous if the downlaod failed.

Have you tried using "option batch abort"?
Guest




Fixed it.

I hate to admit it, but it was a simple logic error in the batch file.

All is working perfectly.

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