On Fri, 31 Aug 2007, Siju George wrote:

/usr/bin/ssh 172.16.2.26 -l root diff /usr/logs/fw/squid/access.log
/usr/logs/fw/squid/access.log.bak > /usr/logs/fw/squid/access.log.`date
"+%Y%m%d"`

What should I do to get the redirected output to be got in a file on
172.16.2.26 ?

You need to escape the ">" char like this "\>"
or IMHO better would be to just surround the whole
command with "" so your local shell won't try
to interpret the stdout direction.

/usr/bin/ssh 172.16.2.26 -l root "diff /usr/logs/fw/squid/access.log
/usr/logs/fw/squid/access.log.bak > /usr/logs/fw/squid/access.log.$(date '+%Y%m%d')"

PS. I think $() for command execution is preferred
instead of backticks. And sorry about the line wrapping,
you can fix that yourself :-)

--
Antti Harri

Reply via email to