Percent sign % doesn't work in crontab
P粉818088880
2023-08-24 23:01:55
<p>I'm having a cron problem with <code>curl</code>:</p>
<pre class="brush:php;toolbar:false;">curl -w "%{time_total}\n" -o /dev/null -s http://myurl.com >> ~/log< ;/pre>
<p> Works great and adds a line with total_time in the log file. </p>
<p>But the same line as cron does nothing. </p>
<p>This is not a path issue, since <code>curl http://myurl.com >> ~/log</code> works. </p>
%
is a special character forcrontab
. Fromman 5 crontab
:So you need to escape the
%
characters:to