Synchronize customized .mac homepages with sitecopy

Mar 19, '03 08:59:00AM

Contributed by: jjgb

I just set up my .mac homepage, and was looking for a way to synchronize the changes to the site on my local copy with the .mac server. I found a tool called sitecopy, available through fink, that does exactly what I needed. Follow the steps detailed in the rest of the article to synchronize your custom homepage.

[robg adds: Please note that this tip is for those of you who have set up custom .mac homepages. If you're using the standard .mac pages, you don't need this hint. I haven't tested it yet, but I will soon, as I just updated my page last night and this would have made it much easier!]

How to synchronize a local folder with your .mac homepage:

  1. Install Fink. I downloaded the most recent version: 0.51 for Mac OS X 10.2.

  2. Since sitecopy is an untested package, you have to move the info file from the unstable packages to the local directory, using:
    cp /sw/fink/10.2/unstable/crypto/finkinfo/sitecopy-ssl-0.11.4-5.info \
    /sw/fink/10.2/local/main/finkinfo/
    This step might change if you're using a different version of Fink. I first tried installing the sitecopy package (without SSL), but had some trouble with a dependent package called neon-shlib.

  3. Run the following command to download, compile and install the package:
    fink install sitecopy-ssl
    This package has a lot of dependencies. Using a fresh Fink installation on a cable connection, it took about three hours to download and compile all the required packages on a PowerMac G4/400.

  4. Close your terminal window and open a new one or type rehash to be able to use sitecopy.

  5. Type the following commands on a terminal window to create setup files:
    
    % cd ~
    % mkdir -m 700 .sitecopy
    % touch .sitecopyrc
    % chmod 600 .sitecopyrc
    
  6. Using your favorite text editor, create a new site definition in your .sitecopyrc file. You may have several site definitons in this file. Sitecopy supports FTP and WebDAV. The following settings are for a WebDAV site like the .mac iDisk:
    site 
        server idisk.mac.com
        remote //Sites/
        local /Library/WebServer/Documents/
        username 
        password 
        protocol webdav
        http expect
    
    For example:
    site mysite
        server idisk.mac.com
        remote /johndoe/Sites/Blog/
        local /Library/WebServer/Documents/Blog/
        username johndoe
        password johndoespassword
        protocol webdav
        http expect
    
    Replace:

    Type man sitecopy to learn about other options.

  7. Finally, use any of the following commands to set up your synchronization:

    sitecopy --catchup sitename if you have an existing remote site.
    sitecopy --catchup sitename if you have an existing remote site.
    sitecopy --fetch sitename to discover what is on the remote site, followed by sitecopy --synch sitename to download it.
    sitecopy --init sitename if you have a new remote site. Make sure that your remote directory has already been created on the server.
    sitecopy --update sitename to update the remote copy of the site.
    sitecopy sitename to learn about changes you have made to the local site since the last update.
sitecopy has many other options to ignore files, ignore permissions, maintain symbolic links and so on. You can learn more about it on the man page. So far my only concern with this tool is about security, since the http secure option doesn't seem to work with .mac servers.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030316214150913