[oclug] rsync, ssh, and cron

Derek T. Murphy (Home) derekm at NightTiger.ca
Wed Apr 7 09:04:26 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 6 Apr 2004,  Michael P. Soulier [ MPS ] wrote:

MPS > > I've created a cron job to regularly backup a remote directory.  The
MPS > > command looks like:
MPS > > su - dle -c 'rsync -e ssh -aqz www.foo.bar:/usr/websites/foo.bar/www
MPS > > /home/dle/projects/foo/'
MPS > >
MPS > > However, something there -- either rsync or ssh -- does not like it.
MPS > > Something about being run by cron is tripping it up, as the command
MPS > > works fine when I run it by hand.  I receive the error output via
MPS > > local email: standard in must be a tty.

I had much the same thing happen, and I found a solution, but I don't
promise it's the correct one:
	Try running it with the "-t" switch:

su - dle -c 'rsync -t -e ssh -aqz www.foo.bar:/usr/websites/foo.bar/www
/home/dle/projects/foo/

This attaches a pseudo-terminal to the command. (I suspect there's
something in the user's .bashrc that uses escape chars is the problem.)

I'm idly curious why you wouldn't run this directly under dle's crontab?

- -- 
                 Derek T. Murphy <DerekM at NightTiger.ca>
    Night Tiger Inc.  Kanata,  Ontario,  Canada  (613) 266-NTSC (266-6872)
   System Administration/Network Security  PGP/GPG keys: www.NightTiger.ca
           "The answer is *computers*. What's your _question_?"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFAc/xfRVr2W6BTungRAn4RAJ4jeXoaIyn+C2CJ/N5mZWSm22PJ9ACfS4AP
47wwPoDx5FPj3cqKaeW8/Nc=
=Ax+m
-----END PGP SIGNATURE-----




More information about the OCLUG mailing list