LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-13-2005, 06:42 AM   #1
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Rep: Reputation: 47
crontab & mplayer static


I put together a simple script that uses mplayer to play a radio stream. If I run this script using the keyboard it runs fine. If I put it into crontab, it plays along with a bunch of static. Any ideas why I get static?

Here's the script (radio):

clear
/usr/local/bin/mplayer -nortc -playlist /home/huntz/high.pls

Here's the crontab list:

30 7 * * * sh /home/huntz/radio

Here's high.pls:

[playlist]
NumberOfEntries=1
File1=http://shout.gnax.net:5112
Title1=ChristianRock.Net
Length1=0
Version=1

Last edited by linuxhippy; 11-13-2005 at 06:53 AM.
 
Old 11-14-2005, 03:09 PM   #2
Back_to_Linux
Member
 
Registered: Sep 2005
Location: PARIS
Distribution: Mandriva 10.0 Communoty
Posts: 117

Rep: Reputation: 15
perhaps mplayer need a shell with environnement variable?
crontab is very special, it launch applications or scripts with shell, without anything you see usually for a user.
 
Old 11-14-2005, 05:58 PM   #3
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
Quote:
Originally posted by Back_to_Linux
perhaps mplayer need a shell with environnement variable?
crontab is very special, it launch applications or scripts with shell, without anything you see usually for a user.
I'm not sure how to do this-could you provide an example or a link?
 
Old 11-16-2005, 03:15 PM   #4
Back_to_Linux
Member
 
Registered: Sep 2005
Location: PARIS
Distribution: Mandriva 10.0 Communoty
Posts: 117

Rep: Reputation: 15
when you launch in crontab, try type
30 7 * * * /bin/sh /home/huntz/radio
because crontab don't know where is the interpreter.
In radio script, you can include an execution of the user's profile, who have the rigth to eXecute the script. Try in header of the script :
. /home/huntz/.bash_profile (don't forget the "." at the first caracter of the line)
or, try :
30 7 * * * su - huntz "-c /bin/sh /home/huntz/radio" (with double cotes)
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab & comm subst (Debian) hyllplan Linux - Enterprise 0 01-14-2005 09:03 AM
chkrootkit & rkhunter crontab Sabicas Linux - Security 1 11-27-2004 07:49 AM
/etc/crontab & environment variables gepesz Linux - Software 3 09-03-2004 01:26 AM
Xine streaming audio static, Mplayer window too small deadlove75 Linux - Software 0 04-08-2004 01:08 AM
Crontab 3 vs java 1.4.2 & socket-communication P-hier Linux - Networking 0 07-18-2003 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:47 AM.

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