Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr4294 :: Schedule audio recordings on the command line - A bit of fine tuning

Kevie tweaks the crontab command for better results with multiple recordings

<< First, < Previous, Next > Latest >>

Thumbnail of Kevie
Hosted by Kevie on Thursday, 2025-01-16 is flagged as Clean and is released under a CC-BY-SA license.
CLI, audio, streaming, radio, recording, ripping, music. 1.

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:05:18

general.

TuxJam co-host Kevie follows up on HPR4287 with a bit of a tweak to the Crontab, but still using the ffmpeg command to record.


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 TinyURL .


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 crontab -e ) and add the following to the end of the file, before the extension: $(date +"%Y_%m_%d")


So the template chances from:

* * * * * ffmpeg -i https://streamurl -t HH:MM:SS /path/filename.ogg

to

* * * * * ffmpeg -i https://streamurl -t HH:MM:SS /path/filename$(date +"\%Y_\%m_\%d").ogg

I forgot to say in the show that you need to add \ before % in Cron or it will not behave as expected.

The example of recording Dan Lynch's Pic and Mix show on Arrow Radio every Thursday at 7pm would now be:

00 19 * * 4 ffmpeg -i https://tinyurl.com/msm6ya6f -t 02:00:00 ~/Recordings/DanLynchPickMix$(date +"\%Y_\%m_\%d").ogg



Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2025-01-14 08:36:55 by Ken Fallon

Nice to see the progression

When I heard you say that you were going to overwrite the file without specifying the -y option, I thought I got disappointment with that one myself by times.

I've written my own approach to this because who doesn't want to hear Dan Lynch Pick Mix.

Yes I owe a show.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
Who is the host of this show?
What does HPR mean to you?