LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-07-2020, 08:03 PM   #1
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 702

Rep: Reputation: 152Reputation: 152
schedule and terminate activity


Hi,

I would like to listen to a radio stream broadcast from the UK. The problem is that this a simple stream. There is no catch up facility. You have to listen from the stream as it is broadcast.

I am interested in a show broadcast 5am-7am my time. This straddles my wake up and “go to work” times. I am looking for suggestions on how to grab the stream at 5am and terminate 2 hours later or at 7am.

My first thought was to set off a cron job for 5am – wget the stream. Not sure how I would tell this to stop though as the stream is continuous.

Any ideas?

Cheers
 
Old 09-07-2020, 08:30 PM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,773

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by timl View Post
Hi,

I would like to listen to a radio stream broadcast from the UK. The problem is that this a simple stream. There is no catch up facility. You have to listen from the stream as it is broadcast.

I am interested in a show broadcast 5am-7am my time. This straddles my wake up and “go to work” times. I am looking for suggestions on how to grab the stream at 5am and terminate 2 hours later or at 7am.

My first thought was to set off a cron job for 5am – wget the stream. Not sure how I would tell this to stop though as the stream is continuous.

Any ideas?

Cheers
Make a script to start the wget download to a file then put a sleep statement in it. Once the time has expired the script will exit and you should have your stream.

Edit: You may need a kill wget or something similar to stop it once the time has expired, now I think more on it.

Last edited by HappyTux; 09-07-2020 at 08:32 PM.
 
Old 09-08-2020, 01:29 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,246
Blog Entries: 3

Rep: Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588Reputation: 2588
Another option is to use cron or at to launch your downloader.

If you need either to launch a graphical program, then use the DISPLAY environment variable.

Then use another job for pkill.

Or precede it all with timeout and a time limit when the script is launched.

Last edited by Turbocapitalist; 09-08-2020 at 01:32 AM.
 
Old 09-08-2020, 02:33 AM   #4
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 702

Original Poster
Rep: Reputation: 152Reputation: 152
Quote:
Originally Posted by Turbocapitalist View Post

Or precede it all with timeout and a time limit when the script is launched.
Thanks turbocapitalist.
Quote:
timeout 120m wget http://server.aradio.net:8100/stream -O /home/tim/test$(date +%Y%m%d).mp3
Is exactly what I was looking for. I ran a couple of tests and it looks good so I have set up the cron job for tomorrow morning.

I'll report back then.

The joys of linux and learning
 
Old 09-09-2020, 05:15 AM   #5
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 702

Original Poster
Rep: Reputation: 152Reputation: 152
Yup, all good. Show received and being listened to now.

Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tentative Schedule Meets Tentative Schedule For ATO LXer Syndicated Linux News 0 08-11-2014 05:10 PM
LXer: Schedule Tasks Using Gnome-schedule (cron & at GUI) LXer Syndicated Linux News 0 07-28-2007 01:31 AM
shell_exec() and friends terminate PHP script (or time out?) MicahCarrick Programming 3 09-05-2006 05:37 AM
programming ideas: track and terminate child processes feetyouwell Programming 2 09-23-2004 11:27 AM
jvm won't terminate beccala33 Linux - Newbie 0 05-14-2002 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration