I built a file upload system called Filexer which does something equivalent this for updating a web server. It is not a journaling system, though it does keep a log like tye mentioned. Not a transaction system but anyway I'll describe our experience with it.

There are a staging server and a live server with various virtual hosts accessible by user permission. The program checks modification dates (md5sums were removed since a converter is run to do a global replace on embedded hyperlinks during conversion). It runs on the live server The other server is accessible as a mounted drive over a datacenter LAN.

The requirement was for both sides to be scanned and only files which are older or nonexistent on the live server are candidates for uploading, likewise only those existing on the live server and not the staging server are candidates for deletion. In fact the ability to roll back was not required.

Some fine points are that it makes subdirectories and ignores protected files, and uses a cygwin version of touch which I discovered can set modification times of uploaded files on the live server in Windows. Selected ranges of access logs are downloaded to a place with ftp permissions and email is sent to the user too. Providing a directory listing was also required.

Anyway if you run the system on the live server and copy everything first to another folder, then replace files by renaming them, the operation should be pretty quick. Faster would be to make symbolic links on your live server for major folders and then switch the one you want with its updated copy instantaneously. Otherwise you may have people accesing a partially updated folder briefly, I didn't find it a big problem since we only handled a very small number of files to be uploaded at once.

I don't know what your purpose is but for us, we had to allow non-technical people to do this work on off-hours. It is far better than depending on some providers' upload request forms. It may sound like some pretty easy stuff but sweating the small points (like NT permissions) can keep you awake for a while. Good luck with your project, it sounds useful.


In reply to Re: Move files w/ commit-rollback mechanism? by mattr
in thread Move files w/ commit-rollback mechanism? by chunlou

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.