[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] NewFiles Script



Hello Folks,

This afternoon I finally sat down and wrote a small MacPerl dropplet to help
with a problem I've had for some time, and thought some of you might be
interested in it.

Having worked all day on a local copy of a client's website, I'd like a
convenient way to identify all files that have changed, in order to upload
just those changed files to the operational server.

I've tried a few Mac FTP clients that claim to do mirroring and
synchronization, but haven't been happy with the stability of any of those.
Anarchie seems to be the only 100% stable FTP client (on my machine), and
unfortunately it only has a uni-directional _mirror_ feature, which for
various reasons isn't sufficient for my needs.

So, today I've written a MacPerl script to help. If you drop a folder on the
script, it begins by asking you the maximum age (in days) of files you want
copied. It then creates a new folder (with the name appended with the date--
e.g. foobar.990522), and copies over only files that are newer than your
specified number of days, while mirroring the source directory structure.
(It will _not_ copy those annoying Icon files.)

For my purposes, I'll then tar the resulting folder, FTP it to the root of
the site on my operational machine, and then untar it-- thereby replacing
outdated files, and creating new ones where applicable.

Written by a perl hacker with limited experience, the script is probably
crude by most standards, but it works for me. But I figured my problem may
be common among Mac-based web developers, so if any of you are interested in
using and/or (hopefully) improving the script, just let me know.

Interesting additional features could be the optional tarring and gzipping
of the output folder (having stripped the appended date) and even FTPing
that tar'd zip'd file to the remote server, or directly FTPing the new files
to the server (creating new directories where needed.) Another feature could
be optional line-ending conversion of text-files (Mac to Unix).

Kind regards,

    -- Matt

Matt Henderson   |   matt@exponet.net   |    www.exponet.net
                 .                      .
E x p o n e t   M e d i a  T e c h n o l o g i e s   G m b H
Full-Service Web Development & Engineering Services Provider

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org