By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,089 Members | 2,432 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,089 IT Pros & Developers. It's quick & easy.

FTPLIB - retry files?

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Peter A.Schott wrote:
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

Jul 18 '05 #2

P: n/a
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 <ma*******@mceahern.com> wrote:
Peter A.Schott wrote:
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


Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.