crontab+mplayer alarm clock


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting crontab+mplayer alarm clock
# 8  
Old 08-06-2012
No. Your crontab entry would be something like:

Code:
15 06 * * *  /home/username/bin/my_alarm.bash >/tmp/alarm.log 2>&1

The script is started by cron at 6:15 each morning.

Hope that's a bit more clear.
# 9  
Old 08-06-2012
Quote:
Originally Posted by agama
No. Your crontab entry would be something like:

Code:
15 06 * * *  /home/username/bin/my_alarm.bash >/tmp/alarm.log 2>&1

The script is started by cron at 6:15 each morning.

Hope that's a bit more clear.
Sorry. It's not working. I have made a file, say "cronfile",
which contains the above line.

Then if I execute

crontab cronfile

I don't get any result !
# 10  
Old 08-06-2012
Are there any messages in the log file: /tmp/alarm.log

What happens if you run your script from the command line?
# 11  
Old 08-07-2012
Quote:
Originally Posted by agama
Are there any messages in the log file: /tmp/alarm.log

What happens if you run your script from the command line?
Code:
cat /tmp/alarm.log

gives
Code:
/bin/sh: 1: alarm.bash: not found

But I don't see anything to happen from the command line.

Let me state once again what I have done.

I have created a bash file called alarm.bash .

Code:
cat alarm.bash

gives

Code:
#!/usr/bin/env bash
PLAYER=/usr/bin/mplayer
SONG=/usr/share/sounds/gnome/default/alerts/glass.ogg


for (( i = 0; i < 5; i++ ))
do
   /usr/bin/amixer sset Master 10%+ >/dev/null 2>&1
   $PLAYER -really-quiet -vo null $SONG >/dev/null 2>&1
done

And created a file called cronscript.
Code:
cat cronscript

yields
Code:
15 06 * * *  alarm.bash > /tmp/alarm.log 2>&1

Now


Anything I'm missing?
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Alarm clock error while executing the script

I am executing perl script on Linux machine and the script is running for the last 5 hours and while running the script I had an error message in a single line Alarm Clock and the script got stopped. I havnt scheduled the script.I have executed the script manually. There is no syntax errors in... (1 Reply)
Discussion started by: scriptscript
1 Replies

2. Shell Programming and Scripting

Scripting an alarm

Hi All, I am monitoring batch Processes running in UNIX environment. I use PuTTy to monitor the process running. I have to continuously monitor and look on the screen if some error has come or not. If an error comes FAILURE word is displayed instead of SUCCESS as shown below on the... (2 Replies)
Discussion started by: sampandey31
2 Replies

3. UNIX for Dummies Questions & Answers

alarm

Hello I have a server HP ES40 with unix 5.1B, and if i open from Start-Programs-IN Tools-GUI/pfmalarm/Alarm-start monitoring , I receive this error message "IOR : STRING IS TOO LONG ! MAXIMUM SIZE = 1024" Anybody heard about this error? Thanks Alin (0 Replies)
Discussion started by: tomaalin
0 Replies
Login or Register to Ask a Question