On 5/8/07, James D. Parra <[EMAIL PROTECTED]> wrote:
Hello,

Having a couple of problems with rsync and keys. I need to run an rsync
session as a cron job and need to bypass the password request. I generated
the local and public keys and have the public key saved in the target
machine in ~/.ssh/authorised_keys, however whenever I use ssh or rsync both
still request a password.


Is your private key in ~/.ssh/id_rsa ?

If so, I think it should work. (for everyone except root.  For root
there may be other issues.  I never do that.).

FYI: I have ssh and rsync working without passwords.

FYI2: If your running rsync from cron, I recommend using the
--partial_dir argument.  It will allow a "large file" transfer to be
interrupted in the middle and pickup where it left off the next time
around.

FYI3: I have my nightly rsync wrapped with bash retry logic like this

=== Bash retry logic for rsync
START=`date +%s`
MAX_TIME='14400'    # 4 hours--Keep restarting if the timeout is in
the middle of the night

for (( DELTA=0 ; DELTA < MAX_TIME ; DELTA = NOW - START))
do
       rsync -avh --stats --timeout=1800 --partial-dir=...
if [ $? != 30 ]
then
  break
fi
NOW=`date +%s`
done
===

The 30 return code happens if you have a timeout.  I have those
occasionally and thus the retry loop.  I started with a smaller
timeout, but if you are sending a 2 or 3GB file when the timeout
occurs, then it can take 10+ minutes to restart the data i/o and
shorted timeouts keep you from ever reconnecting.

Greg
--
Greg Freemyer
The Norcross Group
Forensics for the 21st Century
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to