Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Synchronize customized .mac homepages with sitecopy UNIX
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:
    • mysite with any identifier for your site
    • johndoe with your .mac username
    • johndoespassword with your .mac password
    • remote specifies the remote directory where your site will be uploaded. In this example, I used a subdirectory called Blog, inside the Sites folder.
    • local refers to the directory in your computer where you keep your site's local copy.

    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.
    •    
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[10,517 views]  

Synchronize customized .mac homepages with sitecopy | 3 comments | Create New Account
Click here to return to the 'Synchronize customized .mac homepages with sitecopy' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Synchronize customized .mac homepages with sitecopy
Authored by: pixelcort on Mar 19, '03 04:00:27PM
For those of you who don't want to have to deal with all those steps, rsync is a much better option. Sorry for the self-plug, but I have written a nice little frontend to rsync called iMirror (http://homepage.mac.com/pixelcort/imirror/) . This AppleScript Studio app is very simple: Two text fields, a checkbox and a button. Just mount your iDisk in the Finder and then run iMirror. Click on the button and rsync will figure out the changes that you have made and upload them. iMirror is also good for backing up to a r/w location, such as another partition or something. http://homepage.mac.com/pixelcort/imirror/ (iMirror) is licenced under the GNU Public License and the source code is available. You could probably add a line of code to mount your iDisk so that you don't have to mount it seperately. That's the power of open-source combined with AppleScript Studio!

[ Reply to This | # ]
Synchronize customized .mac homepages with sitecopy
Authored by: jjgb on Mar 19, '03 05:10:27PM

I think that your program (iMirror) and sitecopy are targeted to different audiences. Sitecopy offers much more flexibility when dealing with multiple sites. It also does a great job when you do not want all the files in your site synchronized (for example, you might choose to ignore files with a particular extension).

From the sitecopy page comparison between rsync and sitecopy:

rsync can handle changes to existing files much more efficiently than sitecopy, by only transmitting the differences: sitecopy will always completely re-upload changed files. On the other hand; sitecopy can handle moving and renaming files more efficiently than rsync; it can simply move or rename the file on the server, whereas rsync will completely re-upload the file when it is moved or renamed.

Finally, I find sitecopy particularly useful because I have a single shell command to regenerate my site (using a couple of perl scripts), and update the differences in the server. I am also planning to incorporate my weblog rebuilding (with Movable Type) and uploading into the same script.



[ Reply to This | # ]
Synchronize customized .mac homepages with sitecopy
Authored by: pixelcort on Mar 19, '03 04:55:54PM
For those of you who don't want to have to deal with all those steps, rsync is a much better option. Sorry for the self-plug, but I have written a nice little frontend to rsync called iMirror (http://homepage.mac.com/pixelcort/imirror/) . This AppleScript Studio app is very simple: Two text fields, a checkbox and a button. Just mount your iDisk in the Finder and then run iMirror. Click on the button and rsync will figure out the changes that you have made and upload them. iMirror is also good for backing up to a r/w location, such as another partition or something. http://homepage.mac.com/pixelcort/imirror/ (iMirror) is licenced under the GNU Public License and the source code is available. You could probably add a line of code to mount your iDisk so that you don't have to mount it seperately. That's the power of open-source combined with AppleScript Studio!

[ Reply to This | # ]