I'm trying to backup a remotely-hosted website onto my local Debian Sarge machine using lftp's "mirror" command, but I keep running into a problem where it seems that the remote server persistently resets the connection after a certain length of time. For example, my latest attempt started at 19:09 tonight, and copied files successfully until 19:40, until it seems the remote server decided time was up, and reset all further connections until I killed the job a few hours later.
The debug output for each failed connection attempt (at 10-minute intervals) looked like:
2007-03-29 19:40:56 dns cache hit
2007-03-29 19:40:56 ---- Connecting to xxxxxxxx.org (80.93.17.32) port 21
2007-03-29 19:40:57 (--- 220 ProFTPD 1.3.0a Server (Main FTP Server) [80.93.17.32]
2007-03-29 19:40:57 ---) FEAT
2007-03-29 19:40:57 (--- 211-Features:
2007-03-29 19:40:57 (--- MDTM
2007-03-29 19:40:57 (--- REST STREAM
2007-03-29 19:40:57 (--- SIZE
2007-03-29 19:40:57 (--- 211 End
2007-03-29 19:40:57 ---) USER uuuuuuuu
2007-03-29 19:40:57 (--- 331 Password required for uuuuuuuu.
2007-03-29 19:40:57 ---) PASS pppppppp
2007-03-29 19:40:57 (--- 230 User uuuuuuuu logged in.
2007-03-29 19:40:57 ---) CWD /xxxxxxxx.org/components/com_babackup
2007-03-29 19:40:58 (--- 250 CWD command successful
2007-03-29 19:40:58 ---) PASV
2007-03-29 19:40:58 (--- 227 Entering Passive Mode (80,93,17,32,225,124).
2007-03-29 19:40:58 ---- Connecting data socket to (80.93.17.32) port 57724
2007-03-29 19:40:58 ---- Data connection established
2007-03-29 19:40:58 ---) NLST
2007-03-29 19:40:58 **** data-socket: Connection reset by peer
2007-03-29 19:40:58 ---- Closing data socket
2007-03-29 19:40:58 ---- Closing control socket
Can anybody provide any clues as to why this is happening and how I can work around it?
Thanks a lot.
Tony.
Bookmark/Search this post with:
FTP connection
There are many reasons why it could fail:
1. file does not exist at specified path
2. no access to path
3. attempting more than 1 connection on a machine which only allows 1 connection per IP# (having a browser open to the ftp site counts as a connection)
I'm sure there are other reasons why it would fail. Have you checked your logfiles to see if any useful information was dumped there? Also see if your tool has a 'verbose' option to display more info.
FTP connection
Thanks.
Like I said, I'm using lftp's "mirror" command, which backs up an entire site to a local machine, overwriting only those files which have not changed since the previous backup; it always stops working and goes into a disconnect/connect loop after a period of time, and for the rest of the day will not copy files at all if restarted. What I gave is the full debug output.
I've since come to the conclusion that the server limits FTP activity time on a daily basis (is that a common practice, anybody?), so I've rewritten the backup script to kill the mirroring process after a configurable amount of time (currently 35 mins); if I run the script every day, the backup archive gets bigger each time until it reaches full size and then it should just take a couple of minutes to do the incremental backup each time.
Tony.
$world=~s/war/peace/g;
FTP connection
Administrators can use any number of schemes to limit traffic and it is impossible to tell what is happening from the information provided. Some site maintainers don't like people mirroring without talking to them or have very strict rules on how to go about creating a mirror. Whatever the cause, you're better off talking to the site maintainers.
FTP connection
Thanks again.
All I'm doing is backing up the site (which I have taken over maintaining), not mirroring it as such.
Rather than it being a deliberate time-limit disconnection, I've since discovered (on the lftp mailing list archives) that it's a ProFTPd server bug (or maybe a feature), something to do with it not liking empty directory lists. I'm using the recommended workaround, and it seems to work fine now.
Tony.
$world=~s/war/peace/g;
(P.S. I'm really excited, today is the latest Etch target release date! What do people reckon are the odds of it actually happening?)