develooper Front page | perl.macosx | Postings from January 2002

MacOSX-File-0.50.tar.gz uploaded to CPAN

Dan Kogai
January 18, 2002 10:57
MacOSX-File-0.50.tar.gz uploaded to CPAN
Message ID:

   I just uploaded MacOSX-File-0.50.tar.gz to CPAN.  It now comes with 
psync, a very simple utility that does update copy.  With this, you can 

sudo psync / /Volumes/backup

   to get the full backup of your boot volume while listening to iTunes 
and surfing the web and writing this very mail.  Utility like this was 
the very reason I wrote this module.

see also:


PSYNC(1)       User Contributed Perl Documentation       PSYNC(1)

         psync [-n][-q|-vI<n>] source_items ... target_directory

        psync does an update copy.  It compares source directory
        and target directory at first, then erases items that are
        nonexistent on source directory and finally copies every-
        thing on source directory.  Items items with the same mod-
        ification date and (data fork) size remain untouched, sav-
        ing time on operation.

        Currently psync supports options below

        -n  "Simulation mode".  It prints what it would do on
            standard output but does nothing thus far.

        -vn Sets verbose level.  Default verbose level is 1;  It
            prints only items that are changed.  Level 2 prints
            unchanged files also.  Level 3 and above are practi-
            cally debugging mode.

        -q  Quiet mode.  Sets verbose level to 0.

        To backup everything in startup volume, all you have to
        say is

          sudo psync / /Volumes/I<backup>

        And the resulting backup volume is fully-bootable copy
        thereof.  Note "sudo" or root privilege is necessary to
        restore file ownership.

        On PowerBook G3 (pismo) with G3/400, 384MB Memory,  I
        tested with "/usr/bin/time -l sudo psync / /Vol-
        umes/backup".  The boot volume contains no more than
        vanilla OS X 10.1.2 and Developer kit.  It had a little
        over 85000 items and 1.5 GB of used space.  Here is the

             1st run
             2539.48 real       121.97 user       290.78 sys
             Following run
              452.98 real        47.29 user        39.38 sys

        Note screensaver was on with some other background pro-
        grams.  I used this program happily with my PowerBook G4
        while I am surfing the web and listening to iTunes at the
        same time letting SETI@Home search for cosmic programmers
        :)  With MacOS X, background backup is no problem

        Using this utility over network such as AFS and NFS don't
        work well because of file permissions.  There are several
        ways to overcome this problem but for the time being it is
        not implemented.

        On the other hand this utility works very well on not only
        HFS+ but also UFS.  It even works with on disk images so
        backup over AFS is still possible in theory by making a
        huge disk image on an AFS volume.

        The author of this utility will be held no responsibility
        for possible damages and losses of data and/or files
        caused by the use thereof.  Use me at your own risk.

        Dan Kogai <>

        the 1 entry in the pcpmac manpage



        "The Finder and File Operations"

        Copyright 2002 Dan Kogai <>

        This library is free software; you can redistribute it
        and/or modify it under the same terms as Perl itself. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About