echo Impossible|sed 's/Im/To be /'

May 10, 2008

[tip] rsync over ssh

[rsync over ssh] <--> [rsync 透過 ssh 與遠端主機同步]

$> cat rsync_from.sh
#!/bin/bash
# 拉
#
LOGIN="login_name"
SITE="127.0.0.1"
DIRPATH="public_html/"
cd ~
rsync -avlR -e ssh ${LOGIN}@${SITE}:${DIRPATH}/* .
$> cat rsync_to.sh
#!/bin/bash
# 推
#
LOGIN="login_name"
SITE="127.0.0.1"
DIRPATH="public_html/"
cd ~
rsync -avlR ${DIRPATH}/* -e ssh ${LOGIN}@${SITE}: