Siju George wrote:
Hi
I wrote a script and am trying to run this command
/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"`
on 172.16.2.26 from another machine 172.17.2.0
However the file ( access.log.`date "+%Y%m%d"` ) gets created on the machine
where the script is executed ( i.e 172.17.2.0 ) and not on the machine where
the command is executed using ssh ( i.e 172.16.2.26 )
What should I do to get the redirected output to be got in a file on
172.16.2.26 ?
Thank you so much
Kind Regards
Siju
$ ssh [EMAIL PROTECTED] 'remote_command > remote_logfile'
Note the single ticks, without them redirection is done by the local shell.
--Heinrich