Sponsored Content
Full Discussion: crontab+mplayer alarm clock
Top Forums Shell Programming and Scripting crontab+mplayer alarm clock Post 302682153 by hbar on Sunday 5th of August 2012 04:29:12 PM
Old 08-05-2012
crontab+mplayer alarm clock

I'm trying to run a alarm.sh using crontab, which play a song as
an alarm at 6.15 am. I'm using amixer so that volume increases by 10% in every loop.

My script is the following.
Code:
SHELL=/bin/bash
PLAYER=/usr/bin/mplayer
SONG=/home/hbar/Music/song.mp3
DISPLAY=:0.0

15 06 * * * /usr/bin/amixer sset Master 10%+ > /dev/null && $PLAYER -loop 5 $SONG > /dev/null 2>&1

However, nothing is happening! If I don't use amixer, song is played in the desired time.

(For testing I was changing the time to a time after 1 minute of the current time, so it's not that I need to wait till 6.15 am.)

Thanks.

Last edited by Franklin52; 08-06-2012 at 03:47 AM.. Reason: Please use code tags for data and code samples
 

3 More Discussions You Might Find Interesting

1. 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

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. 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
alarm(3)						     Library Functions Manual							  alarm(3)

Name
       alarm - schedule signal after specified time

Syntax
       #include <unistd.h>

       unsigned alarm(seconds)
       unsigned seconds;

Description
       The  subroutine	causes signal SIGALRM, see to be sent to the invoking process in a number of seconds given by the argument.  Unless caught
       or ignored, the signal terminates the process.

       The requests are not stacked.  Successive calls reset the alarm clock.  If the argument is 0, any request is canceled.  Because of schedul-
       ing delays, resumption of execution of when the signal is caught may be delayed an arbitrary amount.  The longest specifiable delay time is
       100000000 seconds. Values larger than 100000000 will be silently rounded down to 100000000.

       The return value is the amount of time previously remaining in the alarm clock.

Environment
       When your program is compiled using the System V environment, rounds up any positive fraction of a second to the next second.

       When your program is compiled using the POSIX environment, takes a parameter of type unsigned, and returns a value of type unsigned.

See Also
       getitimer(2), sigpause(2), sigvec(2), signal(3), sleep(3)

																	  alarm(3)
All times are GMT -4. The time now is 08:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy