LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-25-2005, 08:26 PM   #1
caps_phisto
Member
 
Registered: Sep 2004
Location: NH
Distribution: FC6, FC1-4, RH9, Gentoo 2006.0/1, Slackware 10.1/2,11, Vector SOHO 5.0.1
Posts: 237

Rep: Reputation: 30
Cron troubles


I am having a wee bit o' trouble with cron today....
I have been trying to setup cron to wake me up in the morning (alram clock)
I have made sure that I am listed in /etc/cron.allow
I have made my own script in my home directory and I run this in my cron file that I make by issuing the "crontab -e" command.
Yet it produces no sound.
I checked my command in the command line and I know this works:
Code:
mplayer -really-quiet -playlist /home/<my user here>/.playlist
Figured it might be an mplayer issue so I placed this command in place of the mplayer command above, in my script:
Code:
sox /home/<my user here>/Metallica/TheCallOfKtulu.ogg - ossdsp /dev/sdp
Again, in cron this does not work, but if I issue it at a command line it works like a charm....

My /var/log/cron output is:
Code:
Jan 25 20:53:51 dhcppc5 crontab[6267]: (user) REPLACE (user)
Jan 25 20:53:51 dhcppc5 crontab[6267]: (user) END EDIT (user)
Jan 25 20:54:01 dhcppc5 crond[2628]: (user) RELOAD (cron/user)
Jan 25 20:56:11 dhcppc5 crontab[6347]: (user) BEGIN EDIT (user)
Jan 25 20:56:19 dhcppc5 crontab[6347]: (user) REPLACE (user)
Jan 25 20:56:19 dhcppc5 crontab[6347]: (user) END EDIT (user)
Jan 25 20:57:01 dhcppc5 crond[2628]: (user) RELOAD (cron/user)
The alarm was supposed to go off a minute after each "edit" above.

Thanks in advance.


PS-I do OWN that Metallica song! 'Cause we all know that METALLICA RULES!
 
Old 01-25-2005, 08:52 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
For your script try:

Code:
#!/bin/sh
mplayer -really-quiet -playlist /home/user/.playlist > /home/user/m.log 2>&1
This will give you a log to look at, to see what the output from mplayer was.
And have you really named the playlist ".playlist"?

I've tried it with a single song, and it worked.
Code:
#!/bin/sh
mplayer -really-quiet /home/user/song.mp3 > /home/user/mp.log 2>&1
 
Old 01-26-2005, 11:18 AM   #3
caps_phisto
Member
 
Registered: Sep 2004
Location: NH
Distribution: FC6, FC1-4, RH9, Gentoo 2006.0/1, Slackware 10.1/2,11, Vector SOHO 5.0.1
Posts: 237

Original Poster
Rep: Reputation: 30
Yes, I really did name my playlist ".playlist"...

Thanks for the extra log command there, I am not at my home PC and cannot try it out. I will as soon as I can though.

Thanks
 
Old 01-26-2005, 07:04 PM   #4
caps_phisto
Member
 
Registered: Sep 2004
Location: NH
Distribution: FC6, FC1-4, RH9, Gentoo 2006.0/1, Slackware 10.1/2,11, Vector SOHO 5.0.1
Posts: 237

Original Poster
Rep: Reputation: 30
Added that log command to the script. Ran it with cron and again the commands did not run. The output did not make it to the log I created.

But, again if I ran that command in the command line it all works...this is really weird.

Thanks again
 
Old 01-26-2005, 07:11 PM   #5
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Whats the crontab line your using? and did you try it with a single file?
Once you've edited the crontab do a crontab -l and see what it produces.
 
Old 02-13-2005, 05:21 PM   #6
grimthingcom
LQ Newbie
 
Registered: Apr 2004
Distribution: Debian
Posts: 3

Rep: Reputation: 0
Full path names

First of all, you need the full path name to the script in your crontab, e.g.:

Code:
20 6 * * 1-5 /home/user/scriptname
Secondly, make sure your script is chmod'ed executable (700 will be fine).

Read this if you're still having trouble.
 
Old 02-18-2005, 06:49 AM   #7
caps_phisto
Member
 
Registered: Sep 2004
Location: NH
Distribution: FC6, FC1-4, RH9, Gentoo 2006.0/1, Slackware 10.1/2,11, Vector SOHO 5.0.1
Posts: 237

Original Poster
Rep: Reputation: 30
Hey Grim!

Yeah I read that article you made a while back! I was trying to reproduce it with Fedora Core 3 but it does not seem to be working. I did use the full path name in my cron file when I created it the first time, it was still a no go. I even tried just using the command in the script instead and again it was no go. This is really wierd.
 
Old 03-06-2005, 10:50 PM   #8
audibel
Member
 
Registered: Oct 2004
Distribution: Debian Sarge
Posts: 177

Rep: Reputation: 30
I'm having the exact same problem... Anyone know what's going on?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron bash script troubles zzyzx Slackware 3 04-12-2005 12:27 PM
Cron script troubles Galphar Linux - Newbie 1 01-19-2005 01:32 PM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM

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

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