in reply to perl script accesing another server

You could create a simple ftp-script. It should remove the current content of server 2 and copies all the new content from server 1 to server 2.

You can choose to call this program from inside your cgi-app or through a schedular, depending on when you want your update to be done.

Update

There is another quick solution along the lines of:

[user@server1]$ tar -czvf - web/ | ssh user@server2 'rm -rf web/ ; tar + -xzvf -'

From man ssh to login without a password::

ssh implements the RSA authentication protocol automatically. The user creates his/her RSA key pair by running ssh-keygen(1). This stores the private key in $HOME/.ssh/identity and the public key in $HOME/.ssh/identity.pub in the user's home directory. The user should then copy the identity.pub to $HOME/.ssh/authorized_keys in his/her ho +me directory on the remote machine (the authorized_keys file corresponds +to the conventional $HOME/.rhosts file, and has one key per line, though +the lines can be very long). After this, the user can log in without givin +g the password. RSA authentication is much more secure than rhosts authe +n­ tication.

This has a few advantages:

Replies are listed 'Best First'.
Re (tilly) 2: perl script accesing another server
by tilly (Archbishop) on Jul 26, 2001 at 16:12 UTC
    An even quicker solution is to use rsync over ssh. It offers all of the same advantages except that it also offers the following:
    1. Substantially faster.
    2. Fewer places to make bad assumptions.
    3. Not as dependent upon a persistent network connection.
    4. You can handle deletes as well.