Crontab not playing


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab not playing
# 1  
Old 01-28-2011
Crontab not playing

This is my crontab:
Code:
MAILTO=""

# m h  dom mon dow   command
# Check to see if the fridge door has been left open
* * * * * fridgedoor 

#Get temperature readings from fridge and save to monthly file in Downloads
30 0,4,8,12,16,20 * * * fridge 
40 0 * * * sendfridge

* * * * * fridgedoor doesn't work
But the other two (fridge and sendfridge) do!

Fridgedoor is:

Code:
REAL=$(/usr/bin/digitemp_DS9097 -a -q -o"%.0C" -c /etc/digitemp.conf)
if [ "${REAL}" -ge 1 ] ;then
play /home/brafferton/Downloads/fridge.wav    
play /home/brafferton/Downloads/fridge.wav    
play /home/brafferton/Downloads/fridge.wav    
fi

Entering "Fridgedoor" on the command line works perfectly, but not in crontab

Any suggestions?

Last edited by Yogesh Sawant; 02-01-2011 at 06:40 AM.. Reason: added code tags
# 2  
Old 01-28-2011
crontab does not have the same environment variables (the PATH in this case) that you personally have when you login. Specify the entire filename: /path/to/fridgedoor

If fridgedoor is a script be sure to put things like this on top
Code:
#!/bin/bash
/path/to/my/home/.profile
# add other variables here
# .. rest of code

This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 01-28-2011
Didn't seem to make any difference,
All three scripts are in the /usr/bin directory, and the other two work fine.

They do have the bin bash line on top, but the forum did something wierd with the typeface whenever I tried to include the first line of the script, so I deliberately left it out.

---------- Post updated at 05:14 PM ---------- Previous update was at 04:19 PM ----------

For some odd reason, it sort of worked when I did a restart - after updating/upgrading.
On editing crontab afterwards, I found that the line had not been inserted.
So I started again, and the damn thing worked.
Sorry to waste your time, but thanks for the info.

Last edited by Fitch; 01-28-2011 at 12:59 PM.. Reason: spellnig error
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Having issue Playing Netflix.

Hi Friends, I am having an issue playing Netflix. Any idea what might cause the issue? (5 Replies)
Discussion started by: Ronald0258
5 Replies

2. UNIX for Dummies Questions & Answers

sed command playing with me!

Hello guys, I was working with my data (a tab delimted text file) in Linux and wanted to replace all "NaN" values in my huge table with "NA", so i used the following sed command: sed 's/NaN/NA/g' /filepath -> outputfile.txt The results were good, all "NaN" were replaced with "NA", but the... (7 Replies)
Discussion started by: Error404
7 Replies

3. Shell Programming and Scripting

Playing with httpd.conf

Hello Guys !! wanted to use SED to pull cout the full vertualhost entry for domain which is specified from command line Like (IP base httpd.conf) domain="ServerName takemewithyou.in" sed -n '/<VirtualHost* $domain/,/<\/VirtualHost>/p' httpd.conf File can take to test is below ... (0 Replies)
Discussion started by: SilvesterJ
0 Replies

4. Linux

Playing with the Linux Scheduler

Hi, To begin with let me explain my system and then I will come to the problem. System: My program forks 2 child processes. These child processes further start 2 user level threads (pthreads) and 2 kernel level threads (kthread). All these threads issue various system calls. I am using... (1 Reply)
Discussion started by: demigod85
1 Replies

5. Shell Programming and Scripting

Playing with parameters

Can someone help me of doing something like this send.sh #!/bin/bash for last; do true; done echo $* | gammu sendsms TEXT $last every thing is good except that when i launch the script like this ./send.sh This is the message i want to send +63922XXXXXXX it turned out the message of... (2 Replies)
Discussion started by: arturo322
2 Replies

6. Homework & Coursework Questions

Playing games from another directory?

If "photopia.dat" is a game. To play it, you would normally type "frotz photopia.dat" (assuming you are in the directory where photopia.dat resides). But what if you are in your home directory, photopia.dat is in the newly created "games" directory, and you want to play it without switching... (1 Reply)
Discussion started by: greeky
1 Replies

7. SCO

Help! Playing with Xenix!

Hey everyone! I'm trying to retrieve old files from my Xenix computers. So the option I've now come down to is to load up a second harddrive and do a doscp of my tar'd backup file. Now, How do I go about this? I am not a unix user myself so I'm not quite sure. I need help! I have a VERY short... (1 Reply)
Discussion started by: Slaughter
1 Replies

8. UNIX for Dummies Questions & Answers

playing audio

Hi all, I play audio through the web browser and it plays ok on windows. When i try the same thing on unix i get the error message "sh: /usr/local/bin/sox: not found. I've tried 'locate sox' and can't seem to find it. Is there some way I can change the browser settings so they play the audio... (3 Replies)
Discussion started by: molli_81
3 Replies

9. Windows & DOS: Issues & Discussions

Windows Buffering during playing

Hello! Will someone out there pls help in clearifying what is really wrong with my system. I use window 98 as my operating system. I am connected to a proxy server for browsing the net. Whenever l am listening to music online l have the problem of intermitted break in which the playing will... (10 Replies)
Discussion started by: kayode
10 Replies
Login or Register to Ask a Question