Updated Robo DJ Workflow

2023-04-08 16:29:00 +0000
#playlists #tilderadio #ezstream #icecast #DJing

I have recently reevaluated my robo DJ processes for my Tilderadio shows "DJ Kate's Tales From The Crates" and "DJ Kyoko Time". My old automation processes can be found here.

My new process now involves the following new processes:

  1. Random picking of a playlist from a playlist folder called "playlists";
  2. Plugging in the playlist in the ezstream xml file;
  3. Running ezstream;
  4. Moving the played playlist folder from "playlists" folder to a separate folder called "played" so it does not get picked again randomly;
  5. And finally, moving all the played playlists from the folder "played" back to the "playlists" folder where they can be picked again randomly once all of the playlists have been played.

Creating media files to make up a playlist, i.e. streaming the mix for the first time while recording it and then preparing the mix for restreaming by the robo DJ, remains unchanged (refer to "My Media Files" section of the old blog).

Updated: Random Picking Of A Playlist & Livestreaming It Using ezstream

The updated script ezstream_kate_random now looks like this:

folder=`find /Users/gary/Music/radio/playlists/kate* -maxdepth 100 -type d | /opt/local/bin/gshuf | head -1`
sed -i .bak -e "s|.*<\/filename>|${folder}\/playlist.txt<\/filename>|g" /Users/gary/.ezstream/ezstream_kate.xml
/usr/local/bin/ezstream -c /Users/gary/.ezstream/ezstream_kate.xml

Moving The Played Playlist So That It Does Not Get Streamed Again

I have created a new script called mv_folder_kate to be executed after the stream is completed (a separate cron job). This action cannot be included in the first script as the stream will stop once the script starts executing the line that moves the folder (ezstream will suddenly lose the media files to stream as the mv line will execute even before ezstream finishes streaming).

last_playlist=$(grep "playlist.txt" /Users/gary/.ezstream/ezstream_kate.xml | sed 's/^.*\/Users\/gary\/Music\/radio\/playlists\/kate/\/Users\/gary\/Music\/radio\/playlists\/kate/' | sed 's/\/playlist.txt<\/filename>//')
mv "$last_playlist" /Users/gary/Music/radio/playlists/played/kate/

Moving All Played Playlists Back to Original Folder Once There Is No More Playlist To Stream

This is accomplished by a new script called test_kate:

if ls /Users/gary/Music/radio/playlists/kate* >/dev/null 2>&1; then
		exit 0
		mv /Users/gary/Music/radio/playlists/played/kate/* /Users/gary/Music/radio/playlists/

My New crontab

0 1 * * * /Users/gary/ezstream_scripts/./ezstream_kyoko_random > /tmp/stdout.log 2> /Users/gary/log/ezstream.log
0 6 * * * /Users/gary/ezstream_scripts/./ezstream_kate_random > /tmp/stdout.log 2> /Users/gary/log/ezstream.log
0 7 * * 1,2,3,4,5,6 /Users/gary/ezstream_scripts/./ezstream_kyoko_random > /tmp/stdout.log 2> /Users/gary/log/ezstream.log
0 12 * * * /Users/gary/ezstream_scripts/./ezstream_kate_random > /tmp/stdout.log 2> /Users/gary/log/ezstream.log
0 13 * * * /Users/gary/ezstream_scripts/./ezstream_kyoko_random > /tmp/stdout.log 2> /Users/gary/log/ezstream.log
0 18 * * 0,1,3,5,6 /Users/gary/ezstream_scripts/./ezstream_kate_random > /tmp/stdout.log 2> /Users/gary/log/ezstream.log
0 19 * * 0,1,3,4,5,6 /Users/gary/ezstream_scripts/./ezstream_kyoko_random
30 19 * * 0 /Users/gary/ezstream_scripts/./kill_kyoko
0 0 * * * /Users/gary/ezstream_scripts/./ezstream_kate_random > /tmp/stdout.log 2> /Users/gary/log/ezstream.log
55 23,5,11,17 * * * /Users/gary/ezstream_scripts/./test_kate && /Users/gary/ezstream_scripts/./test_kyoko
45 0,6,12 * * * /Users/gary/ezstream_scripts/./mv_folder_kate
45 18 * * 0,1,3,5,6 /Users/gary/ezstream_scripts/./mv_folder_kate
45 1,13 * * * /Users/gary/ezstream_scripts/./mv_folder_kyoko
45 7 * * 1,2,3,4,5,6 /Users/gary/ezstream_scripts/./mv_folder_kyoko
45 19 * * 0,1,3,4,5,6 /Users/gary/ezstream_scripts/./mv_folder_kyoko


A note on copyright:

All of the tracks included in my live mixes are not my work, unless otherwise stated. I do not receive any monetary compensation for doing my live shows. My activities on and Tilderadio are/were/have always been strictly a personal hobby. and Tilderadio are both for-hobby, not-for-profit, non-commercial and fully volunteer-member-run and funded Internet radio services. If your track/piece of work gets included in my mixes then it means that I love and admire you and your work and I am in effect promoting you and your work to my listeners for free.

However, if you are an artist and are still not satisfied with my explanation in the above paragraph, please contact me.


made with jekyll and vim

powered by the SDF Public Access UNIX System
"Get your own free UNIX shell and free homepage now!"

Titillium Web fonts by Accademia di Belle Arti di Urbino

background image is a screenshot taken from the music video "Mi Teletipo" by Oviformia SCI

codes for website HTML javascript clock obtained from

jekyll tagging codes and credits: Long Qian

super-search script by Kushagra Gour (chinchang)