[oclug] rsync, ssh, and cron
oclug at raj.homelinux.com
Tue Apr 6 22:32:31 EDT 2004
On Tue, 2004-04-06 at 21:28, Dave Edwards wrote:
> On 2004-04-06 18:08+0000, Hugh Campbell wrote:
> > On Tue, 6 Apr 2004 17:35:30 -0400, Dave Edwards wrote:
> > >I've created a cron job to regularly backup a remote directory.
> > >The
> > command looks like:
> > >su - dle -c 'rsync -e ssh -aqz www.foo.bar:/usr/websites/foo.bar/www
> > /home/dle/projects/foo/'
> > >However, something there -- either rsync or ssh -- does not like it.
> > >Something about being run by cron is tripping it up, as the command
> > >works fine when I run it by hand. I receive the error output via
> > >local email: standard in must be a tty.
oh, and did I mention that cron does NOT read your .profile, so you
might also want to try /usr/sbin/su /usr/bin/rsync instead of rsync
(replace paths to suit)
> > Dave
> > This rings a bell with me I think. It may have something to do with
> > the su environment that you are su'ing into.
> > Have you tried running it from rsync's crontab? This is what I do
> > and it seems to work perfectly.
> Thanks, Hugh. As we briefly discussed at tonight's meeting, I wonder
> how this approach to the problem works with my (dle's) ssh
> particulars, the ones required to log into the remore machine.
More information about the OCLUG