About a Mplayer Cron Job
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I'm currently tinkering with a process to play an internet radio stream on a certain schedule everyday.
After some research, I came up with this code for Crontab :
00 22 * * * mplayer http://listen.acertainradio.com >/dev/null 2>&1
30 22 * * * pkill mplayer
Does It sounds correct? Also, I was wondering about the >/dev/null 2>&1
part. What would be the problem if I skip it?
Thank you,
Regards,
cron mplayer
add a comment |Â
up vote
-1
down vote
favorite
I'm currently tinkering with a process to play an internet radio stream on a certain schedule everyday.
After some research, I came up with this code for Crontab :
00 22 * * * mplayer http://listen.acertainradio.com >/dev/null 2>&1
30 22 * * * pkill mplayer
Does It sounds correct? Also, I was wondering about the >/dev/null 2>&1
part. What would be the problem if I skip it?
Thank you,
Regards,
cron mplayer
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I'm currently tinkering with a process to play an internet radio stream on a certain schedule everyday.
After some research, I came up with this code for Crontab :
00 22 * * * mplayer http://listen.acertainradio.com >/dev/null 2>&1
30 22 * * * pkill mplayer
Does It sounds correct? Also, I was wondering about the >/dev/null 2>&1
part. What would be the problem if I skip it?
Thank you,
Regards,
cron mplayer
I'm currently tinkering with a process to play an internet radio stream on a certain schedule everyday.
After some research, I came up with this code for Crontab :
00 22 * * * mplayer http://listen.acertainradio.com >/dev/null 2>&1
30 22 * * * pkill mplayer
Does It sounds correct? Also, I was wondering about the >/dev/null 2>&1
part. What would be the problem if I skip it?
Thank you,
Regards,
cron mplayer
cron mplayer
edited Aug 21 at 0:47
Rui F Ribeiro
36.6k1271116
36.6k1271116
asked Aug 13 at 16:04
Porprenaz
1
1
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
If you skip the redirection to /dev/null, then any output generated by the command (pkill, I assume) will be sent to your account on the system as an e-mail (which you can read from the command line with the "mail" command).
You might also want to consider placing the full paths to the mplayer and pkill command, just to ensure that whatever shell is used can find them, irrespective of whichever environment variables (i.e. PATH) are set or not.
add a comment |Â
up vote
0
down vote
Just went through this. May not be the best way...but here goes.
First I needed to auto-mount a USB containing the music. The magic line in /etc/fstab looks like this:
LABEL=Kiwa-Music /mnt/Music auto lazytime,nofail, 1 1
Then I did a line like this in the crontab:
55 * * * * /home/pi/mplayerup
Finally there the file:
pi@kiwa-Audio:~ $ cat mplayerup
set -x
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Proc="mplayer"
sleep 5
ps ax | grep -v grep | grep $Proc | grep -v mplayerup 1>/dev/null 2>/dev/null
if [ $? = 1 ] ;
then cd /mnt/Music/Music
/usr/bin/mplayer -shuffle -playlist 0-Playit.m3u 1>/dev/null 2>/dev/null
fi
The set -x and sleep 5 are supposed to be commented out...dunno what's going on here.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
If you skip the redirection to /dev/null, then any output generated by the command (pkill, I assume) will be sent to your account on the system as an e-mail (which you can read from the command line with the "mail" command).
You might also want to consider placing the full paths to the mplayer and pkill command, just to ensure that whatever shell is used can find them, irrespective of whichever environment variables (i.e. PATH) are set or not.
add a comment |Â
up vote
2
down vote
If you skip the redirection to /dev/null, then any output generated by the command (pkill, I assume) will be sent to your account on the system as an e-mail (which you can read from the command line with the "mail" command).
You might also want to consider placing the full paths to the mplayer and pkill command, just to ensure that whatever shell is used can find them, irrespective of whichever environment variables (i.e. PATH) are set or not.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
If you skip the redirection to /dev/null, then any output generated by the command (pkill, I assume) will be sent to your account on the system as an e-mail (which you can read from the command line with the "mail" command).
You might also want to consider placing the full paths to the mplayer and pkill command, just to ensure that whatever shell is used can find them, irrespective of whichever environment variables (i.e. PATH) are set or not.
If you skip the redirection to /dev/null, then any output generated by the command (pkill, I assume) will be sent to your account on the system as an e-mail (which you can read from the command line with the "mail" command).
You might also want to consider placing the full paths to the mplayer and pkill command, just to ensure that whatever shell is used can find them, irrespective of whichever environment variables (i.e. PATH) are set or not.
answered Aug 13 at 16:13
Dominic Watkins
512
512
add a comment |Â
add a comment |Â
up vote
0
down vote
Just went through this. May not be the best way...but here goes.
First I needed to auto-mount a USB containing the music. The magic line in /etc/fstab looks like this:
LABEL=Kiwa-Music /mnt/Music auto lazytime,nofail, 1 1
Then I did a line like this in the crontab:
55 * * * * /home/pi/mplayerup
Finally there the file:
pi@kiwa-Audio:~ $ cat mplayerup
set -x
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Proc="mplayer"
sleep 5
ps ax | grep -v grep | grep $Proc | grep -v mplayerup 1>/dev/null 2>/dev/null
if [ $? = 1 ] ;
then cd /mnt/Music/Music
/usr/bin/mplayer -shuffle -playlist 0-Playit.m3u 1>/dev/null 2>/dev/null
fi
The set -x and sleep 5 are supposed to be commented out...dunno what's going on here.
add a comment |Â
up vote
0
down vote
Just went through this. May not be the best way...but here goes.
First I needed to auto-mount a USB containing the music. The magic line in /etc/fstab looks like this:
LABEL=Kiwa-Music /mnt/Music auto lazytime,nofail, 1 1
Then I did a line like this in the crontab:
55 * * * * /home/pi/mplayerup
Finally there the file:
pi@kiwa-Audio:~ $ cat mplayerup
set -x
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Proc="mplayer"
sleep 5
ps ax | grep -v grep | grep $Proc | grep -v mplayerup 1>/dev/null 2>/dev/null
if [ $? = 1 ] ;
then cd /mnt/Music/Music
/usr/bin/mplayer -shuffle -playlist 0-Playit.m3u 1>/dev/null 2>/dev/null
fi
The set -x and sleep 5 are supposed to be commented out...dunno what's going on here.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Just went through this. May not be the best way...but here goes.
First I needed to auto-mount a USB containing the music. The magic line in /etc/fstab looks like this:
LABEL=Kiwa-Music /mnt/Music auto lazytime,nofail, 1 1
Then I did a line like this in the crontab:
55 * * * * /home/pi/mplayerup
Finally there the file:
pi@kiwa-Audio:~ $ cat mplayerup
set -x
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Proc="mplayer"
sleep 5
ps ax | grep -v grep | grep $Proc | grep -v mplayerup 1>/dev/null 2>/dev/null
if [ $? = 1 ] ;
then cd /mnt/Music/Music
/usr/bin/mplayer -shuffle -playlist 0-Playit.m3u 1>/dev/null 2>/dev/null
fi
The set -x and sleep 5 are supposed to be commented out...dunno what's going on here.
Just went through this. May not be the best way...but here goes.
First I needed to auto-mount a USB containing the music. The magic line in /etc/fstab looks like this:
LABEL=Kiwa-Music /mnt/Music auto lazytime,nofail, 1 1
Then I did a line like this in the crontab:
55 * * * * /home/pi/mplayerup
Finally there the file:
pi@kiwa-Audio:~ $ cat mplayerup
set -x
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Proc="mplayer"
sleep 5
ps ax | grep -v grep | grep $Proc | grep -v mplayerup 1>/dev/null 2>/dev/null
if [ $? = 1 ] ;
then cd /mnt/Music/Music
/usr/bin/mplayer -shuffle -playlist 0-Playit.m3u 1>/dev/null 2>/dev/null
fi
The set -x and sleep 5 are supposed to be commented out...dunno what's going on here.
answered Aug 24 at 18:17
Sydney Kotic
1
1
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462341%2fabout-a-mplayer-cron-job%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password