~sschwarzer/ftputil#6: 
Add an FTP mirror script

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.

Status
REPORTED
Submitter
schwa (unverified)
Assigned to
No-one
Submitted
18 years ago
Updated
14 days ago
Labels
enhancement

swordsp@gmail.com (unverified) 17 years ago · edit

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

schwa (unverified) 17 years ago · edit

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?

swordsp <swordsp@gmail.com> (unverified) 17 years ago · edit

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...

swordsp <swordsp@gmail.com> (unverified) 17 years ago · edit

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...

swordsp <swordsp@gmail.com> (unverified) 17 years ago · edit

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.

Register here or Log in to comment, or comment via email.