LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2003, 11:42 PM   #1
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
simple cron job: not working


I wrote a scrpit that plays a song (an MP3)

Code:
#!/bin/bash
                                                                                                                             
/usr/bin/mpg123 /home/robert/wakeup.mp3
very simple script, almost pointless to have the script but it's there and it works

i made a cron job to run this script at 8 am every day:

Code:
0 8 * * *  robert  /home/robert/alarm > /dev/null 2>&1
i ran the /home/robert/alarm > /dev/null 2>&1 and it plays the song and
doesnt output all the extra text that comes with runnign mpg123.

now, i decided to make a cron job to run this every 5 minutes so i could test it
out now (to see if it works).

Code:
*/5 * * * * ....(same as above)
i get this in my syslog ( /var/log/messages)
Code:
Oct 31 00:30:00 decatur CRON[5523]: (robert) CMD (/home/robert/alarm > /dev/null 2>&1)
Oct 31 00:30:00 decatur CRON[5524]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Oct 31 00:35:00 decatur CRON[5542]: (robert) CMD (/home/robert/alarm > /dev/null 2>&1)
Oct 31 00:40:00 decatur CRON[5550]: (robert) CMD (/home/robert/alarm > /dev/null 2>&1)
but i hear no music. it works fine in the console but nada when cron plays it.


The goal is to use my computer as my alarm clock

im using Vixie cron in Gentoo (vcron).

Last edited by Robert0380; 10-30-2003 at 11:45 PM.
 
Old 10-30-2003, 11:44 PM   #2
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Original Poster
Rep: Reputation: 47
extra note, the script and mp3 file are owned by user "robert" and the script is set to run as user "robert" not root..
 
Old 09-09-2006, 11:30 AM   #3
DrAxeman
Member
 
Registered: Jun 2004
Location: State of Confusion
Distribution: My other OS is your Solaris box.
Posts: 84

Rep: Reputation: 15
Just thinking aloud:

Who's cron are you running it from? Your's or root's?
 
Old 06-24-2008, 04:45 AM   #4
blue_hunter
LQ Newbie
 
Registered: Jun 2008
Posts: 1

Rep: Reputation: 0
hi, don't use mpg123 to play the music, please use mpg321 instead....
mpg123 got no problem with playing sound in console, but when come to cronjob, you need mpg321 to play it .. and set the process to "quiet".
 
  


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
cron job suddenly stopped working Gisli Linux - Software 1 08-25-2005 12:03 PM
how to make a simple code for just restarting Apache via a Cron job hsa Programming 1 08-22-2005 04:15 AM
GPG cron job not working michredhat Linux - Software 1 12-07-2004 10:27 PM
cron job working2hard Programming 6 07-28-2004 09:12 PM
cron job thesnaggle Linux - Newbie 1 09-19-2003 10:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:57 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