Redjc1990 has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I need to keep the same file on two or more servers identical. Rsync is banned in my environment (don't ask.) I did not see anything in the existing modules that would fit the bill. I can come up with something myself using SSH, but would prefer a "lazier" solution. Any suggestions are appreciated. Thank you, Vic

Replies are listed 'Best First'.
Re: Keeping Files in Sync, without Rsync
by merlyn (Sage) on Oct 26, 2007 at 00:17 UTC
Re: Keeping Files in Sync, without Rsync
by KurtSchwind (Chaplain) on Oct 25, 2007 at 22:48 UTC
    I know that you said rsync was banned, but just to be on the safe side:

    If by banned you mean that you can't have rsyncd running, you should know that you can actually use ssh to run client rsync between two boxes without ever needing to start rsyncd. I've used this before when I was told by some architect that the "r" commands were not allowed. In spite of telling him that rsync only had the letter 'r' in common with rsh/rexec/rhost they weren't buying it. So I used an ssh call to establish the rsync connection. Worked like a champ. I can post a script if you need it.
    I used to drive a Heisenbergmobile, but everyone I looked at the speedometer, I got lost.
Re: Keeping Files in Sync, without Rsync
by tuxz0r (Pilgrim) on Oct 25, 2007 at 22:47 UTC

    rsync is banned in a number of corporate environments (including many of the other "r" commands, rsh, rcp, etc.) but, I don't think you can find a lazier solution than 'ssh' if that's available to you. Generate some ssh keys and put a small script together to 'scp' the file(s) between the servers you need them on. Are there other requirements other than making sure they match on each server?

    ---
    echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'
Re: Keeping Files in Sync, without Rsync
by samtregar (Abbot) on Oct 25, 2007 at 21:50 UTC
    How about not using files? If you put your data in a shared database like MySQL then any processes that need it can get it over the network.

    -sam

Re: Keeping Files in Sync, without Rsync
by jasonk (Parson) on Oct 25, 2007 at 21:06 UTC

    rsync is the lazy solution, if you add arbitrary restrictions then you make more work for yourself. Also, if there is a reason for rsync to be banned, wouldn't that reason likely extend to any rsync-clone you attempted to write in perl?


    We're not surrounded, we're in a target-rich environment!
Re: Keeping Files in Sync, without Rsync
by eric256 (Parson) on Oct 25, 2007 at 21:21 UTC

    It might be overkill but you could use SVN over SSH to keep the files in sync with a periodic commit and update.


    ___________
    Eric Hodges