Extract data with a cron task - file with title like "name_of_file-yyyymmdd.xz"
<p>I would like to extract some data from a file which is create each day at 3am.
The title of the file looks like this : "name_of_file-yyyymmdd.xz" ( y for year, m for month and d for day).
For my test, i try to extract this data every minutes with a cron task :</p>

<pre><code>*/1 * * * * echo"`date -d 'yesterday'`"&gt;&gt;/tmp/result.txt &amp;&amp; xzcat /path_to_file/file-"`date -d 'yesterday' +%Y%m%d`".xz | wc -l &gt;&gt;/tmp/result.txt
</code></pre>

<p>But I have this error : "Syntax Error : premature end of file".
I don't understand because when i write "xzcat /path_to_file/file-"<code>date -d 'yesterday' +%Y%m%d</code>".xz | wc -l" without a cron task ( on the command window) it works.</p>