LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   problem with ssh-based, rsync (https://www.linuxquestions.org/questions/linux-software-2/problem-with-ssh-based-rsync-69940/)

reitsma 07-03-2003 06:46 PM

problem with ssh-based rsync on crontab
 
Hi,

I have a simple shell script that executes an 'rsync' command running on top of ssh. The script works just nicely when run from the command-line in RH 8.0:

export RSYNC_RSH=ssh
rsync -rotWvv /origin_dir my_machine:/destination_dir

However, when I invoke this script through (root's) crontab, it does not work. The error message is as follows:

Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password,keyboard-interactive).

Why is this not working from the cron?

RR

emetib 07-04-2003 08:25 AM

first-
are you having to type the passwd in when you are running the script without it being in the cron? if so, cron isn't able to get the passwd. what it looks like you will have to do is to make an ssh-agent. that will have your key in a file so that you don't have to type it out each time.

here's a page that might help you out. http://www.togaware.com/linux/survivor/SSH_Secure.html

second-
you can run ssh through rsync. that's how i do mine. -e ssh, is the option. i still have to enter my passwd since i haven't made a key to put into an agent.

cheers.

reitsma 07-07-2003 10:35 AM

Dear emetib,

I have set up ssh/RCS keys so that when I run the rsync I am not prompted for a password. As mentioned in my post, the thing runs all by itself (no interaction required) from the command line, but refuses to run from the cron.

RR

emetib 07-07-2003 04:20 PM

the only thing that i can think of is, do you have at the top of your script-

#/bin/bash

then put what you have in a standard text file and give it a shot like that. if that doesn't work, i'm not sure then.

cheers.


All times are GMT -5. The time now is 01:09 PM.