FTPLIB - retry files?

P

Peter A. Schott

Is there any way to retry sending files with some delay up to a set number on
failure? Sometimes we encounter a locked file on our server or the destination
server and we want to retry that file in X seconds.

Not exactly sure how to go about that right now short of moving the files
elsewhere and then queuing them up again.

Anyone done this? I'm still kind of new to this so am open to suggestions on
how this might be possible as well.

Thanks for your help.

-Pete Schott
 
M

Mark McEahern

Peter said:
Is there any way to retry sending files with some delay up to a set
number on
failure? Sometimes we encounter a locked file on our server or the
destination
server and we want to retry that file in X seconds.
In general, what's wrong with this:

import time

retryCount = 10
retrySleep = 5
for x in range(retryCount):
try:
[ftp commands]
except [ftp exceptions]:
time.sleep(retrySleep)
else:
break

// m
 
P

Peter A. Schott

That will probably work. I'll have to do some playing around with it. I'm
still new to all of this but am finding that it can handle a lot of the
functionality I'm looking for: Logging, retries, archiving, etc.

I will try to integrate this and see what happens.

Thanks.

-Pete

Mark McEahern said:
Peter said:
Is there any way to retry sending files with some delay up to a set
number on
failure? Sometimes we encounter a locked file on our server or the
destination
server and we want to retry that file in X seconds.
In general, what's wrong with this:

import time

retryCount = 10
retrySleep = 5
for x in range(retryCount):
try:
[ftp commands]
except [ftp exceptions]:
time.sleep(retrySleep)
else:
break

// m
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top