From: Ralph Slooten <axllent@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] rsync via ssh
Date: Mon, 05 Nov 2007 07:13:59 +1300 [thread overview]
Message-ID: <472E0BE7.90903@gmail.com> (raw)
In-Reply-To: <y65bqaanjs3.fsf@minnie.esd.mun.ca>
I have done a similar thing at work, except what I do is first create an
ssh tunnel, then rsync to the locally listening port. Works perfectly.
In my setup the remote server is running an SSH server which is not
accessible directly. Maybe this will help you.
#!/bin/bash
SSL_COMMAND="ssh -p 2222 sshuser@myserver -f -N -L 8000:localhost:873"
SSL_PID=`ps aux | grep "$SSL_COMMAND" | egrep -v 'grep' | awk '{print $2}'`
if [ "$SSL_PID" == "" ]; then
echo "=> Creating SSH tunnel to myserver"
$SSL_COMMAND
SSL_PID=`ps aux | grep "$SSL_COMMAND" | egrep -v 'grep' | awk
'{print $2}'`
else
echo "=> SSH tunnel already exists. Using existing tunnel."
fi
if [ "$SSL_PID" != "" ]; then
echo "=> Connecting through SSH tunnel with PID $SSL_PID"
rsync rsync://localhost:8000/wwwroot
/mnt/samba/hotcopy/myserver/wwwroot \
-rvtzp --delete --modify-window=1
echo "=> Closing SSH tunnel"
kill $SSL_PID
else
echo "ERROR: SSH Connection failed! The backup could not complete"
fi
Cheers,
Ralph
Roger Mason wrote:
> Hi Richard,
>
> Richard Ruth <richgentoo@pacbell.net> writes:
>
>> Try adding "-e ssh" to your rsync command.
>> Search for "-e" in the rsync man page for an example.
>> =======================
>> This is the crontab entry (in rmason's crontab):
>> 0,15,30,45 * * * * rmason /usr/bin/rsync -av /home/rmason backup_machine:my
>> machine_rmason
>
> Thanks for the reply. Unfortunately that did not work, the same error
> ocurs.
>
> This is what I have currently:
> 0,15,30,45 * * * * /usr/bin/rsync -av -e "ssh" /home/rmason rmason@backup_machine:mymachine_rmason
>
> I've tried with and without the quotes plus with and without the
> rmason@ but none worked.
>
> I think I'll try scp and see what happens.
>
> Cheers,
> Roger
--
gentoo-user@gentoo.org mailing list
next prev parent reply other threads:[~2007-11-04 18:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-03 21:06 [gentoo-user] rsync via ssh Richard Ruth
2007-11-04 14:54 ` Roger Mason
2007-11-04 17:59 ` Steve Dommett
2007-11-04 18:46 ` Roger Mason
2007-11-04 19:04 ` Steve Dommett
2007-11-04 18:13 ` Ralph Slooten [this message]
2007-11-04 18:50 ` Roger Mason
2007-11-04 19:07 ` Neil Walker
-- strict thread matches above, loose matches on Subject: below --
2007-11-03 20:36 Roger Mason
2007-11-04 15:24 ` Dirk Heinrichs
2007-11-04 18:44 ` Roger Mason
2007-11-04 23:40 ` Shawn Haggett
2007-11-05 0:43 ` Steve Dommett
2007-11-05 11:04 ` Roger Mason
2007-11-05 11:38 ` W.Kenworthy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=472E0BE7.90903@gmail.com \
--to=axllent@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox