This box is a dedicated rsync server.
See the
MirrorHowTo for some more rsync info.
More stuff will be added to this page soon (hopefully)!
Sample rsync via ssh script
To sync your site to ahimsa-rsync1 you need to have an account and have ssh keys set up, ask about this in #ahimsa on irc.indymedia.org.
Following are a couple of example scripts for runing the sync.
Using a simple lock file
#!/bin/bash
LOCKFILE=/tmp/rsync.mysitename
SYNC_FROM=/path/to/site/on/local/publishing/box/
SYNC_TO=user@remotehost.example.com:/path/on/remote/server/
lockfile -r 1 $LOCKFILE || exit 23
if [ -f $LOCKFILE ]
then
echo locked!
exit 77
else
touch $LOCKFILE
fi
rsync -e 'ssh' --timeout=120 -CLrptzv --bwlimit=200 --exclude=robots.txt $SYNC_FROM $SYNC_TO
rm -f $LOCKFILE
Using flock
#!/bin/bash
LOCKFILE=/tmp/rsync.mysitename
SYNC_FROM=/path/to/site/on/local/publishing/box/
SYNC_TO=user@remotehost.example.com:/path/on/remote/server/
(
flock -e 200 || exit 23
rsync -e 'ssh' --timeout=120 -CLrptzv --bwlimit=200 --exclude=robots.txt $SYNC_FROM $SYNC_TO
) 200>$LOCKFILE