3

On a MacPro at remote office, I enabled FTP server with

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

Now it works, but when downloading a large file, it will serve for a few seconds, then stop completely for a minute or more ... then resume (using lftp with multiple connections.)

Like this:

enter image description here

Is there any way to fix this? Or is there a more reliable FTP server service we could use?

brew search ftp shows me

bbftp-client   git-ftp        ncftp      pure-ftpd      vsftpd
curlftpfs      lftp           proftpd    uberftp

Are any of these FTP servers that could be set up as an always-on 'service'?

UPDATE: I installed pure-ftpd, got it up and running, and it's doing the same damn thing. 34mbps for 10 seconds, then 0 for 30 or so ... what is going on?

  • 1
    Might it be your connection that is failing, are you on WiFi? Have you tried to do this via AFP, SMB, or the webserver? – CousinCocaine Aug 11 '14 at 20:41
  • You can go to 'System preferences' -> 'Sharing' -> 'File Sharing', that should start your FTP server. And there you can also activate SMB and AFP under options. No need for calling launchctl manually. – CousinCocaine Aug 11 '14 at 20:43
  • AFAIK, Apple removed the FTP option in Mavericks. I don't see it. The only way I know to start it is via launchctl. AFP transfer maintains, but speeds are only 5-10mbps. Maybe going through LogMeIn Hamachi VPN is affecting it. I will have to test a direct connection. – Dan Aug 11 '14 at 20:46
  • You might try 'System preferences' -> 'Sharing' -> 'Remote Login' for a SFTP server. – CousinCocaine Aug 11 '14 at 20:50
  • 1
    → Ze'ev: is Wi-Fi involved there (CousinCocaine ®)? – dan Aug 11 '14 at 21:05
1

Could you test your end to end connection with this simple script based on ping output:

#!/bin/sh
# $Id: coupure.sh,v 1.1 2012/09/05 13:11:10 dan Exp dan $
_host_exist=`host $1`
expr "${_host_exist}" : '.*address' >/dev/null || {
        echo ${_host_exist} >&2
        exit 1
}

ping $1 2>/dev/null |
        perl -e  '
                use strict ;
                use warnings ;

                my $started = 0 ;
                my $start = 0 ;
                my $end = 0 ;
                my $count = 0 ;
                my $was_down = -1 ;
                my $last_up = -1 ;
                my $last_hole = 0 ;
                my $now = 0 ;
                my $x = -1 ;
                my $hour = -1 ;
                my $min = -1 ;
                my $sec = -1 ;
                my $hole = 0 ;
                my $delta = 0 ;
                my $time_run = 0 ;
                my $sum_hole = 0 ;
                my $avg_hole = 0 ;
                my $sum_delta = 0 ;
                my $avg_delta = 0 ;

                sub catch_int {
                        $end = time () ;
                        $time_run = $end - $start ;
                        printf ("\ntime run = %14d s,\tdrop count =  %8d", $time_run, $count) ;
                        if ($time_run) {
                                printf (",\t %8.2f / d\n", $count * 86400 / $time_run) ;
                        } else {
                                printf ("\n") ;
                        }
                        if ($count) {
                                $avg_hole = $sum_hole / $count ;
                                printf ("avg drop time =  %8.2f s\n", $avg_hole) ;
                                if ($count > 1) {
                                        $avg_delta = $sum_delta / ($count - 1); 
                                        printf ("avg int. time =  %8.2f s\n", $avg_delta) ;
                                }
                        }
                        exit ;
                }

                $start = time () ;

                $SIG{INT} = \&catch_int ;

                while () {
#                       printf ("%s", $_) ;

                        if (! $started) {
#                               printf ("%s", $_) ;
                                if ($_ =~ /PING/ ) { next ; }
                                if ($_ =~ /bytes/) {
                                        $was_down = 0 ;
                                } else {
                                        $was_down = 1 ;
                                }
                                $started = 1 ;
                        } else {
                                if ($_ =~ /bytes.*icmp_seq=/) {
#-------+-------+-------+-------+-------+-------+-------+-------+
#                                       target is up
#                                       printf ("!") ;
                                        if ($was_down == 1) {

                                                $count ++ ;
                                                printf ("%4d\t", $count) ;
                                                ($sec, $min, $hour, $x, $x, $x, $x, $x, $x) = localtime ($last_up) ;
                                                printf ("%02d:%02d:%02d\t", $hour, $min, $sec) ;
                                                $now = time () - 1 ;
                                                ($sec, $min, $hour, $x, $x, $x, $x, $x, $x) = localtime ($now) ;

                                                printf ("-\t%02d:%02d:%02d\t", $hour, $min, $sec) ;
                                                $was_down = 0 ;
                                                $hole = $now - $last_up ;
                                                $sum_hole += $hole ;
                                                printf ("= %4d s", $hole) ;

                                                if ($last_hole) {
                                                        $delta = $last_up - $last_hole ;
                                                        $sum_delta += $delta ;
                                                        printf (" + %6d s\n", $delta ) ;
                                                } else {
                                                        printf ("\n") ;
                                                }
                                                $last_hole = $last_up ;
                                        }
                                        $last_up = time() ;
                                } else {
#-------+-------+-------+-------+-------+-------+-------+-------+
#                                       target is down
                                        if ($was_down == 0 ) {
                                                $was_down = 1 ;
                                        }
                                }
                        }
                }'

Just copy this in coupure.sh on your ftp client, type make coupure and run it:

./coupure target_ftp_server
  • I tried ./coupure 25.14.33.139 and it said Host 139.33.14.25.in-addr.arpa. not found: 3(NXDOMAIN) ... seems to be reversing the IP addres?? – Dan Aug 11 '14 at 21:22
  • Yes. That was my only way to check that a name was valid even when ping wasn't answering at first. You might remove the block starting at expr if you don't want to register your ftp server. – dan Aug 11 '14 at 21:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .