Opened 13 years ago

Last modified 11 years ago

#6 assigned enhancement

Add an FTP mirror script

Reported by: schwa Owned by: schwa
Priority: minor Milestone:
Component: Other Version:
Keywords: FTP, mirror, sync, benchmark Cc:

Description

Despite there are many syncing/mirroring scripts for FTP servers out there, it might be worthwhile to bundle such a script with ftputil to:

  • provide a working example of ftputil code
  • learn more about ftputil usage and by that find out about functionality that should be added
  • serve as a benchmark for measurements before and after implementation regarding issue #3

I classify this issue as "minor" because the mirror script isn't that important for the functioning of ftputil.

Change History (10)

comment:1 Changed 13 years ago by schwa

Status: newassigned

comment:2 Changed 13 years ago by anonymous

Component: LibraryOther

comment:3 Changed 13 years ago by schwa

Milestone: 2.12.2

comment:4 Changed 13 years ago by swordsp@…

How about add things like downloadtree() and uploadtree() into FTPHost objects directly?

comment:5 Changed 13 years ago by schwa

I'm a bit hesitant to put all kind of stuff into the FTPHost class. I prefer to write a mirror script first, so I can get a better feeling if/how it fits into FTPHost.

Another reason to put the mirroring into a script first is to gain usage experience before committing to a concrete API in FTPHost.

I also think, that an FTP mirror script would be a better "playground" to experiment with FTP to FTP copy you mention in ticket #15.

What do you think?

comment:6 Changed 13 years ago by swordsp <swordsp@…>

I agree with that.

In my imagine, maybe there will be a module function like this:

def transfer(src_host, src, dst_host, dst, mode, exist):
    ...
}}

The "src_host" and "dst_host" are FTPHost-like objects, the default value can be "shutil" or something else indicate to local file system.
The "src" and "dst" are the path of source file and target file, maybe it also can handle folder?
The "exist" set the strategy when meet exist files, such as "overwrite when newer", "skip", "always overwrite", "resume", "auto rename", just as other ftp client does. (maybe here is a new feature request of "resume" operation or transfer a part of a file?)

At first it's lied in the externel script, once it's proved mature, maybe it can be moved to the ftputil module directly.

I hope I didn't ask for too much...

comment:7 Changed 13 years ago by swordsp <swordsp@…>

Sorry for my mistake, the content of last reply seems broken...

In my imagine, maybe there will be a module function like this:

def transfer(src_host, src, dst_host, dst, mode, exist):
    ...

The "src_host" and "dst_host" are FTPHost-like objects, the default value can be "shutil" or something else indicate to local file system. The "src" and "dst" are the path of source file and target file, maybe it also can handle folder? The "exist" set the strategy when meet exist files, such as "overwrite when newer", "skip", "always overwrite", "resume", "auto rename", just as other ftp client does. (maybe here is a new feature request of "resume" operation or transfer a part of a file?)

At first it's lied in the externel script, once it's proved mature, maybe it can be moved to the ftputil module directly.

I hope I didn't ask for too much...

comment:8 Changed 13 years ago by swordsp <swordsp@…>

Another idea is, once the "resume" and "fxp" operations are support by the low-level ftputil, maybe there can be another module defines something like "FTPTask".

A task can be a group of operation, it can start, stop, resume, queue, schedule, etc, even via mutiple sessions at the same time.

I must say, it's another story about a full-featured python ftp client, not the feature request of this library...

But if there is a full-featured library lied down, it's sure will be possiblely and much easier.

comment:9 Changed 12 years ago by schwa

Milestone: 2.3

comment:10 Changed 11 years ago by schwa

Milestone: 2.3
Note: See TracTickets for help on using tickets.