<p>
<a href="https://tuxjam.otherside.network/" rel="noopener noreferrer" target="_blank">
TuxJam</a>
 co-host <a href="https://mastodon.me.uk/@kevie" rel="noopener noreferrer" target="_blank">
Kevie</a>
 follows up on HPR4287 with a bit of a tweak to the Crontab, but still using the ffmpeg command to record.</p>
<p>
<br>
</p>
<p>
In the previous episode, the example stream url that was given proved to be unpopular with ffmpeg due to the characters that it contained. A quick work around for this was to put it in a url shortener, for this example I'm using <a href="https://tinyurl.com/" rel="noopener noreferrer" target="_blank">
TinyURL</a>
. </p>
<p>
<br>
</p>
<p>
Another issue arose when the stream recorded without first removing the audio file, I could see this being an issue when you want to record a show when you will be away over multiple weeks. To overcome this we simply edit the Crontab file (command <code>
crontab -e</code>
) and add the following to the end of the file, before the extension: <code>
$(date +"%Y_%m_%d")</code>
</p>
<p>
<br>
</p>
<p>
So the template chances from:</p>
<p>
<code>
* * * * * ffmpeg -i https://streamurl -t HH:MM:SS /path/filename.ogg</code>
</p>
<p>
to</p>
<p>
<code>
* * * * * ffmpeg -i https://streamurl -t HH:MM:SS /path/filename$(date +"\%Y_\%m_\%d").ogg</code>
</p>
<p>
I forgot to say in the show that you need to add \ before % in Cron or it will not behave as expected.
</p>
<p>
The example of recording Dan Lynch's Pic and Mix show on Arrow Radio every Thursday at 7pm would now be:</p>
<p>
<code>
00 19 * * 4 ffmpeg -i https://tinyurl.com/msm6ya6f -t 02:00:00 ~/Recordings/DanLynchPickMix$(date +"\%Y_\%m_\%d").ogg</code>
</p>
<p>
<br>
</p>
