-----BEGIN PGP SIGNED MESSAGE-----
I've run into the same problem, trying to run rsync over ssh. My
perusals of online discussions suggest that fixing it is non-trivial.
Yes, I should be able to do > /dev/null 2>&1, but that doesn't work
for this cron job:
55 0 * * * myscript > /root/myscript.log 2>&1
Where myscript contains a series of commands that look like this:
/usr/bin/rsync -avx -e /usr/local/bin/ssh --delete \
/my/dir/path/ remote.mydomain:/my/dir/path
It's been suggested that I can use the BatchMode flag to eliminate tty
checking, so that something like this will work from cron:
/usr/local/bin/ssh -o "BatchMode yes" remote.mydomain uptime \
> /root/uptime.out
And that does, in fact, work. Unfortunately, trying something similar
with rsync involved doesn't work, because invariably, rsync tries to
interpret "yes" as a destination, no matter how I escape the quoted
string. I haven't been able to force that parameter to be passed to
ssh and NOT to rsync in the first example.
I've also read suggestions from some who've modified source code to
fix this, but the file (ttymodes.c) that was suggested to modify
doesn't exist in the ssh-2.3.0 tree ... I'm not a C programmer, but
I'm not afraid to try that, if I can find the appropriate place to
insert the modification.
So ... I s'pose I can just do "xterm -e myscript", and make sure
there's a display to send it to, but wow, is that ever klunky.
Help?
- -d
--
David Talkington
Community Networking Initiative
[EMAIL PROTECTED]
217-244-1962
PGP key: http://www.prairienet.org/~dtalk/dt000823.asc
Dan Vranesic wrote:
>Hi all,
>
>Apologies if this topic has turned up before.
>
>Our firewall can stream application data upon establishing
>a secure connection. Ie. on the following:
>
>ssh <firewall> -l <username>
>
>data will automatically be streamed (it is realtime
>statistics for a server) to the connector's shell.
>
>I'd like to establish such a connection without maintaining
>a shell (simply redirect the output to a file, for example).
>
>Two thoughts were to:
>
>(i) accomplish this via cron, but I'm running into
>the "Pseudo-terminal will not be allocated because stdin is
>not a terminal" problem. I've tried forcing pseudo-tty
>allocation using the -t flag, but have had no luck.
>
>(ii) nohup the ssh process from a shell, but the connection
>dies with the shell.
>
>Thanks in advance for any advice/help.
>
>Dan
>
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8
Comment: Made with pgp4pine 1.75-6
iQEVAwUBOeKlpr1ZYOtSwT+tAQGNmAf/b3OvLfOYkeprsdeO9e2VZNTgEWgbGNEY
sXppk4mV6ANYmfu/7MWYyrRxwVRRtVJGrqm8AR9pNlXKnWAI31TNGebLirRnLYWX
Qx2bfm5bTpcZQA0pGsmmXFIIN1k1ayzJxDDQwQEkoeF/yUjncrAs52sT0eJdW2d/
2RH4CCj4cQ5xcOzVMvJnTeyiPLodaPXMOc8S1oqyzNbX9jj85bgcPp5lVgmFqJka
t5rwul7tqLmLMQDAxk/bO2xqQgxnz/1ulzjfEHCPdTNBbEBSxr/Qek6/EVIf47gS
v9AD6qGqhV/euHE+g919Osd9p7wOWQL5Yl7sBSielyn92rwK+YlHuw==
=15/B
-----END PGP SIGNATURE-----