LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-03-2003, 06:46 PM   #1
reitsma
LQ Newbie
 
Registered: Dec 2002
Location: Corvallis, OR
Distribution: F7
Posts: 21

Rep: Reputation: 15
Question 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

Last edited by reitsma; 07-03-2003 at 06:57 PM.
 
Old 07-04-2003, 08:25 AM   #2
emetib
Member
 
Registered: Feb 2003
Posts: 482

Rep: Reputation: 33
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.
 
Old 07-07-2003, 10:35 AM   #3
reitsma
LQ Newbie
 
Registered: Dec 2002
Location: Corvallis, OR
Distribution: F7
Posts: 21

Original Poster
Rep: Reputation: 15
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
 
Old 07-07-2003, 04:20 PM   #4
emetib
Member
 
Registered: Feb 2003
Posts: 482

Rep: Reputation: 33
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync->ssh port lackluster Linux - Software 2 05-27-2007 08:42 PM
rsync and ssh? IchBin Linux - Newbie 4 02-13-2005 03:41 PM
Rsync vs ssh satimis Linux - Software 7 04-04-2004 06:58 AM
Rsync and SSH Phaethar Linux - Software 3 03-22-2004 03:18 PM
SSH and RSYNC problem pixie Linux - General 2 03-02-2004 11:02 AM


All times are GMT -5. The time now is 04:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration