 <p><a href="https://tuxjam.otherside.network/">TuxJam</a> co-host <a href="https://mastodon.me.uk/@kevie">Kevie</a> does a follow up show to episode <a href="https://hackerpublicradio.org/eps/hpr4249/index.html">4249</a> with a look at scheduling a stream recording using crontab and the <a href="https://ffmpeg.org/">ffmpeg</a> command. The two things that we will need to set this up are the <strong>audio stream url</strong> and the <strong>time of the show</strong>. </p>

<p>To set this up we need to go setup a new Cron task: <code>crontab -e</code> and navigate to the bottom of the file.</p>

<p>The first thing that it will expect you to enter is the timing for this task, this will be written as * * * * * with the information needed being converted into an appropriate number:</p>

<table class="s-table">

<thead>

<tr>

<th>minute</th>

<th>hour</th>

<th>day of month</th>

<th>month</th>

<th>day of week</th>

</tr>

</thead>

<tbody>

<tr>

<td>(0-59)</td>

<td>(0-23)</td>

<td>(1-31)</td>

<td>(1-12)</td>

<td>(0-7)</td>

</tr>

<tr>

<td>*</td>

<td>*</td>

<td>*</td>

<td>*</td>

<td>*</td>

</tr>

</tbody>

</table>

<p>Then we need to enter <code>ffmpeg -i</code> followed by the stream URL.</p>

<p>It is important that we include the duration of the recording, so that this doesn't output a huge file. To set the time enter <code>-t HH:MM:SS</code> making sure to replace the HH(hours) MM(minutes) and SS(seconds) with numbers.</p>

<p>Almost done. The last thing we need to do is to enter the location for the file to go along with the name /path/filename.ogg.</p>

<p>So in short form the command is <code>* * * * * ffmpeg -i https://streamurl -t HH:MM:SS /path/filename.ogg</code>.</p>

<p>The example used in the show for Dan Lynch's Mid Week Pick and Mix: <code>00 19 * * 4 ffmpeg -i https://arrowestream.radioca.st/;?ver=737183.mp3 -t 02:00:00 ~/Recordings/DanLynchPickMix.ogg</code></p>