The following works as expected from the command prompt. But it does not work from cron.
mysqldumpslow <(tail -1000 `mysqladmin variables \
| grep slow_query_log_file | awk '{print $4}'`) \
| mail -s "slow log from `hostname` sorted by time" amar`hostname`@gmail.com \
> /root/slow_succ.txt 2> /root/slow_err.txt
I get the following error:
/bin/sh: -c: line 0: syntax error near unexpected token `('
Do certain characters need to be escaped in cron? Or is it an issue with subshell in cron?