Home
WTUL New Orleans
 
 
 

Last 10 songs Pop-out Direct

 

Hi. This is a guide for people at other radio stations that want to record their content for their station's archival purposes. I've been running it for years and have barely touched it.

This is NOT how you would make an archive that the public would access. There are a lot of reasons why it's not that. This just makes a file recording (a little more than) every two hours of your air time.

This is going to use a Bash script. If that means nothing to you, that's fine, I'll walk you though it, but you'll need something either running linux, MacOS, or if you really want to get freaky the Windows Subsystem for Linux.

What we do is use a Synology NAS full of hard drives. If you really mean for this to run 24/7 for potentially years, you'll want some hard drive space! My instructions are going to be tailored to that route, but the script should work on whatever.

Open a text editor. Synology actually has one built-in. It's not great, but we don't need it to be great.

Copy and paste the following:

#!/bin/bash
filename=show-`date -d "5 minutes" "+%Y-%m-%d_%H"`.mp3
curl -m 7440 https://your.stream.url/ > /your/file/location/$filename

OK, details about these.

#!/bin/bash is arguably unnecessary. It's just making sure that this is being run as a bash script if you're not in a bash shell.

filename=show-`date -d "5 minutes" "+%Y-%m-%d_%H"`.mp3 This is what the file will be named. For our station we swap out the word show for wtul. The rest is formatting it to add on the date 5 minutes in the future. Why 5 minutes in the future? Because we're going to run this script a little before the hour. The result will be a file that looks like "show-2024-10-01_16.mp3" for a 4 o'clock show on October 1st 2024.

curl -m 7440 https://your.stream.url/ > /your/file/location/$filename Change these to fit your use case. So for our station it's https://stream.wtulneworleans.com/ > /volume1/WTUL\ Archive/Show\ Archives/$filename. Keep the $filename part though! "curl" is scraping your web stream and 7440 is the amount of seconds it will be doing it for. In this case it's 124 minutes for a two-hour show. That ">" is telling it to take whatever it gets from your stream and put it into whatever you put after the >.

Why do I run it for 124 minutes? Because people tend to start shows early or run late. If you cap it at 120 minutes, it's very likely that you're going to miss something. But don't worry! These scripts can run in parallel with each other, so one will run before the other one is finished.

OK. Save that file as, I don't know, recordashow.sh. The .sh is important. I put this in a director of scripts on our nas. Maybe you want it in your home folder. Doesn't really matter.

Next you need to make it executable. Which means it's no longer a text document, it's a program. There may be ways to do this on synology's user interface but I didn't see it. Hopefully you have some familiarity with the command line and can get to the file that way. Then type

chmod +x recordashow.sh

Depending on your circumstances, you might need to type sudo chmod +x recordashow.sh

Your script should be ready. If you type ./recordashow.sh it should do its thing. Try it! Run it for a moment, then stop the process with Ctrl+C or equivalent, then check that a file was made.

However, all this is going to do is record 124 minutes from when the file is run. Next it needs a schedule.

If you're comfortable enough with a command line, you can edit /etc/crontab. My line looks like this

58      1-23/2  *       *       *       root    /your/file/location/recordashow.sh

The first column is the minute to start at, the second means to run every two hours starting at 1am, the stars mean every day and month, root is who it runs as, and the last bit is where the file lives.

I haven't tried it, but I believe you can also do this using Synology's user interface. Go to control > task scheduler. Then create > Scheduled task > user-defined script.

Aaaaand that should be it! I hope this was helpful.

Listen LIVE!

 
 
 

Last 10 songs Pop‑out Direct

 

Follow Us

Instagram

Follow us @wtul