Find Jobs
Hire Freelancers

Perl Net::FTP Retry Code Needed

$10-30 USD

Completed
Posted over 9 years ago

$10-30 USD

Paid on delivery
I need this code rewritten to retry 3 times waiting longer each on fail. Before each retry it shall print an update. This is needed because during busy times and bad connections the connecting or putting of the file fails sometimes. If fail, wait 10 seconds and try again. (print "Waiting 10 seconds to Retry") If fail a second time wait 15 seconds and try again. (print "Waiting 30 seconds to Retry") If fail a third time, wait 60 more seconds and try again a final time.(print "Waiting 60 seconds to Retry") If fails a fourth time, print error. $ftp = Net::FTP->new($spr_host_name, Timeout => 30, Passive => 1, Debug => 1,) or die print "\n Can not connect to SPR: $@<br>--FTP Down-- \n"; >>>>>>>>>>>>>> RETRY ABOVE LINE $ftp->put($local_file,$remote_file) or die print "Couldn't Send EDI Request to SPR! $@\n"; >>>>>>>> RETRY ABOVE LINE ----------------------------------------------------------------------- here is the block of perl code. (using Net::Ftp) $ftp = Net::FTP->new($spr_host_name, Timeout => 30, Passive => 1, Debug => 1,) or die print "\n Can not connect to SPR: $@<br>--FTP Down-- \n"; $ftp->login($ftp_login_name,$ftp_login_pass) or die print "Couldn't Login $@\n"; $ftp->put($local_file,$remote_file) or die print "Couldn't Send EDI Request to SPR! $@\n"; print "putting $local_file -to- $remote_file\n"; $ftp->rename($remote_file,$remote_file2) or die print "Couldn't Rename $@\n"; ------------------------------------------------------------------------------ No access to our servers will be given. Please provide the tested and finished block of code in a text file attachment.
Project ID: 6470509

About the project

10 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi nehiac, I got a membership and now have bids. I can complete this work within a day. Thanks Raj
$25 USD in 1 day
5.0 (1 review)
0.6
0.6
10 freelancers are bidding on average $26 USD for this job
User Avatar
Hi! This is pretty easy for me: I can provide you code you need in less than 10 minutes. Just make 100% milestone payment and you'll get working code from me. Thanks. Roman
$29 USD in 1 day
5.0 (194 reviews)
6.2
6.2
User Avatar
Hello, I am the premier Perl scripting expert on these freelancing sites. I will modify your Perl script fragment to include the retry protocols that you specify. The retries will be governed by a list structure for you to configure the waiting times. If I am hired for this task before 3:00 pm EDT today, your script shall be ready before midnight that night. A milestone payment for the full budget for your task must be deposited with this site before your offer can be accepted. Alan Idler Chief Software Architect Idleswell Software Creations
$27 USD in 3 days
4.9 (182 reviews)
6.1
6.1
User Avatar
Hi, We are experts in perl and can write the ftp connect strip as you described. Ready to start now. Thanks.
$26 USD in 1 day
5.0 (99 reviews)
5.6
5.6
User Avatar
hello, I can update the script to support retry on failure for you..............................................................
$30 USD in 1 day
5.0 (31 reviews)
5.4
5.4
User Avatar
Dear potential employer. Follows the code fragment, modified at your request. I hope it will work fine for you. In case of complete satisfaction, please, accept my bid, for me to be able to leave 5-star feedback for you. Please, let me know if you would like to make any further modifications (for example I would strongly advice you to use strict pragma). Looking forward for update from you. Thank you my @delay_periods = qw/ 0 10 30 60 /; my $ftp; foreach my $delay (@delay_periods){ sleep($delay); print "Waiting $delay seconds to Retry\n" if $delay; eval{ $ftp = Net::FTP->new($spr_host_name, Timeout => 30, Passive => 1, Debug => 1,); }; last unless $@; die print "\n Can not connect to SPR: $@<br>--FTP Down-- \n" if $delay == $delay_periods[$#delay_periods]; } $ftp->login($ftp_login_name,$ftp_login_pass) or die print "Couldn't Login $@\n"; foreach my $delay (@delay_periods){ sleep($delay); print "Waiting $delay seconds to Retry\n" if $delay; eval{ $ftp->put($local_file,$remote_file); }; unless($@){ print "putting $local_file -to- $remote_file\n"; last; } else{ die print "Couldn't Send EDI Request to SPR! $@\n" if $delay == $delay_periods[$#delay_periods]; } } $ftp->rename($remote_file,$remote_file2) or die print "Couldn't Rename $@\n";
$25 USD in 1 day
4.9 (12 reviews)
4.8
4.8
User Avatar
Hi I have experience of more than four years. My expertise is in c cpp Linux and perl. I have already modify many standard perl project for custom requirement. I can do this job
$25 USD in 1 day
5.0 (1 review)
2.3
2.3
User Avatar
can do it........................................................................................................................................
$25 USD in 1 day
5.0 (4 reviews)
2.0
2.0
User Avatar
PERL (MVC Catalyst), jquery (javascript), git, sql (mysql, pgsql), php, junior ruby ​​(ruby on ralis), freebsd/linux Experience of more than 6 years of Perl + jQuery + FreeBSD Engines: Xfilesharing (sibsoft), OTRS
$16 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Post Falls, United States
5.0
13
Payment method verified
Member since Jul 27, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.