public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] rsync via ssh
@ 2007-11-03 20:36 Roger Mason
  2007-11-04 15:24 ` Dirk Heinrichs
  2007-11-04 23:40 ` Shawn Haggett
  0 siblings, 2 replies; 8+ messages in thread
From: Roger Mason @ 2007-11-03 20:36 UTC (permalink / raw
  To: gentoo-user

Hello,

I'm trying to use rsync to back up my home directory on "mymachine" to another
machine (backup_machine) using a cron job.

This is the crontab entry (in rmason's crontab):

0,15,30,45 * * * *      rmason /usr/bin/rsync -av /home/rmason backup_machine:mymachine_rmason

The logs on backup_machine show entries like this when the cron job runs:

Nov  3 17:30:06 backup_machine sshd[22048]: error: PAM: Authentication failure for rmason from mymachine.esd.mun.ca
Nov  3 17:30:06 backup_machine sshd(pam_unix)[22052]: authentication failure;
     logname= uid=0 euid=0 tty=ssh ruser= rhost=mymachine.esd.mun.ca
     user=rmason

I have passwordless ssh between mymachine and backup_machine and the
rsync command in the crontab runs perfectly from the command line.

Does someone know what else needs to be done to get this (seemingly
simple!) task to work?

Many thanks,
Roger
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] rsync via ssh
  2007-11-03 20:36 [gentoo-user] rsync via ssh Roger Mason
@ 2007-11-04 15:24 ` Dirk Heinrichs
  2007-11-04 18:44   ` Roger Mason
  2007-11-04 23:40 ` Shawn Haggett
  1 sibling, 1 reply; 8+ messages in thread
From: Dirk Heinrichs @ 2007-11-04 15:24 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

Am Samstag, 3. November 2007 schrieb Roger Mason:
> Hello,
>
> I'm trying to use rsync to back up my home directory on "mymachine" to
> another machine (backup_machine) using a cron job.

Which cron?

> This is the crontab entry (in rmason's crontab):
>
> 0,15,30,45 * * * *      rmason /usr/bin/rsync -av /home/rmason
> backup_machine:mymachine_rmason

Shouldn't this be 

0,15,30,45 * * * * /usr/bin/rsync -av /home/rmason 
backup_machine:mymachine_rmason

HTH...

	Dirk

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] rsync via ssh
  2007-11-04 15:24 ` Dirk Heinrichs
@ 2007-11-04 18:44   ` Roger Mason
  0 siblings, 0 replies; 8+ messages in thread
From: Roger Mason @ 2007-11-04 18:44 UTC (permalink / raw
  To: gentoo-user

Hi Dirk,

Dirk Heinrichs <dirk.heinrichs@online.de> writes:

> Am Samstag, 3. November 2007 schrieb Roger Mason:
>> Hello,
>>
>> I'm trying to use rsync to back up my home directory on "mymachine" to
>> another machine (backup_machine) using a cron job.
>
> Which cron?

vixie-cron

>> This is the crontab entry (in rmason's crontab):
>>
>> 0,15,30,45 * * * *      rmason /usr/bin/rsync -av /home/rmason
>> backup_machine:mymachine_rmason
>
> Shouldn't this be 
>
> 0,15,30,45 * * * * /usr/bin/rsync -av /home/rmason 
> backup_machine:mymachine_rmason

I already tried it without the rmason prepended to the command: no
difference.  FWIW I tried scp and had the same problems.  I think it
has to do with the backup_machine not reading my public ssh key, maybe
because the session is not interactive.

Thanks,
Roger 
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] rsync via ssh
  2007-11-03 20:36 [gentoo-user] rsync via ssh Roger Mason
  2007-11-04 15:24 ` Dirk Heinrichs
@ 2007-11-04 23:40 ` Shawn Haggett
  2007-11-05  0:43   ` Steve Dommett
  2007-11-05 11:04   ` Roger Mason
  1 sibling, 2 replies; 8+ messages in thread
From: Shawn Haggett @ 2007-11-04 23:40 UTC (permalink / raw
  To: gentoo-user

Roger Mason wrote:
> I have passwordless ssh between mymachine and backup_machine and the
> rsync command in the crontab runs perfectly from the command line.
> 
> Does someone know what else needs to be done to get this (seemingly
> simple!) task to work?
> 

How have you setup the passwordless ssh? If your using keys with the ssh 
keyagent, then when the command is run in cron it wouldn't know where to 
find your ssh-agent...

Shawn
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] rsync via ssh
  2007-11-04 23:40 ` Shawn Haggett
@ 2007-11-05  0:43   ` Steve Dommett
  2007-11-05 11:04   ` Roger Mason
  1 sibling, 0 replies; 8+ messages in thread
From: Steve Dommett @ 2007-11-05  0:43 UTC (permalink / raw
  To: gentoo-user

On Sunday 04 November 2007, Shawn Haggett wrote:
> Roger Mason wrote:
> How have you setup the passwordless ssh? If your using keys with the ssh
> keyagent, then when the command is run in cron it wouldn't know where to
> find your ssh-agent...
>
> Shawn

I use a use a key with no password without ssh-agent.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] rsync via ssh
  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
  1 sibling, 1 reply; 8+ messages in thread
From: Roger Mason @ 2007-11-05 11:04 UTC (permalink / raw
  To: gentoo-user

Shawn Haggett <podge@podgeweb.com> writes:

> Roger Mason wrote:
>> I have passwordless ssh between mymachine and backup_machine and the
>> rsync command in the crontab runs perfectly from the command line.
>>
>> Does someone know what else needs to be done to get this (seemingly
>> simple!) task to work?
>>
>
> How have you setup the passwordless ssh? If your using keys with the
> ssh keyagent, then when the command is run in cron it wouldn't know
> where to find your ssh-agent...

Yes, I think that is the problem.  I'm going to try the technique
described here:

http://arctic.org/~dean/rdiff-backup/unattended.html

Will report back.

Cheers,
Roger
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] rsync via ssh
  2007-11-05 11:04   ` Roger Mason
@ 2007-11-05 11:38     ` W.Kenworthy
  2007-11-05 12:17       ` [gentoo-user] rsync via ssh [solved] Roger Mason
  0 siblings, 1 reply; 8+ messages in thread
From: W.Kenworthy @ 2007-11-05 11:38 UTC (permalink / raw
  To: gentoo-user


On Mon, 2007-11-05 at 07:34 -0330, Roger Mason wrote:
> Shawn Haggett <podge@podgeweb.com> writes:
> 
> > Roger Mason wrote:
> >> I have passwordless ssh between mymachine and backup_machine and the
> >> rsync command in the crontab runs perfectly from the command line.
> >>
> >> Does someone know what else needs to be done to get this (seemingly
> >> simple!) task to work?
> >>
> >
> > How have you setup the passwordless ssh? If your using keys with the
> > ssh keyagent, then when the command is run in cron it wouldn't know
> > where to find your ssh-agent...
> 
> Yes, I think that is the problem.  I'm going to try the technique
> described here:
> 
> http://arctic.org/~dean/rdiff-backup/unattended.html
> 
> Will report back.
> 
> Cheers,
> Roger

Keep in mind that cron runs with a very limited environment for safety
reasons.  You have to manually set most env variables and the like.

BillK

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] rsync via ssh [solved]
  2007-11-05 11:38     ` W.Kenworthy
@ 2007-11-05 12:17       ` Roger Mason
  0 siblings, 0 replies; 8+ messages in thread
From: Roger Mason @ 2007-11-05 12:17 UTC (permalink / raw
  To: gentoo-user

"W.Kenworthy" <billk@iinet.net.au> writes:

>> > Roger Mason wrote:
>> >> I have passwordless ssh between mymachine and backup_machine and the
>> >> rsync command in the crontab runs perfectly from the command line.
>> >>
>> >> Does someone know what else needs to be done to get this (seemingly
>> >> simple!) task to work?

>> Yes, I think that is the problem.  I'm going to try the technique
>> described here:
>> 
>> http://arctic.org/~dean/rdiff-backup/unattended.html
>> 
>
> Keep in mind that cron runs with a very limited environment for safety
> reasons.  You have to manually set most env variables and the like.

Yes.  I finally have it working using the technique described in the
above URL.  

Thanks to all who responded.

Roger
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-11-05 12:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-03 20:36 [gentoo-user] rsync via ssh 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
2007-11-05 12:17       ` [gentoo-user] rsync via ssh [solved] Roger Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox