[Tutor] Getting a List of FTP Dirs?

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sat, 3 Mar 2001 05:10:55 -0800 (PST)


On Fri, 2 Mar 2001, Britt Green wrote:

> Part of my job duties is to check an FTP backup site and insure that a
> bunch of files have backed up for that day. I have to check 300
> folders. Ugh. So in a meeting today with a new boss, I said that this
> was a waste of time, and that someone should code up a program to
> automatically check it.

After looking at the original problem, I'm a little curious: does the FTP
backup site have an ssh server installed?  If so, it might be easier to
avoid dealing with FTP altogether:

We can write a script that will do the os.path.walk() thing on the server,
and send its results back to the client.  That might be easier to do, and
I think it might involve less coding.


By the way, you might find the following module useful when verifying a
file, md5 (Message Digest):

    http://python.org/doc/current/lib/module-md5.html

md5 can be used to take a "fingerprint" of a file that can be easily
checked on both your client and backup server.  Could be useful if you
really want to make sure that the files are identical on both backup and
the real server.

Good luck!