I put this line into my crontab: 29 21 * * * xmms -p /home/adagilson/acordar.m3u Although, the command line: xmms -p /home/adagilson/acordar.m3u ...can play a list of mp3 very fine when executed by a Gnome terminal, it is not working with Cron. Take a look at the result from the command CRONTAB -L: $crontab -l #vi crontab 29 21 * * * xmms -p /home/adagilson/acordar.m3u :wq!#You have new mail in /var/spool/mail/adagilson This is the MESSAGE SENT BY CRON: Message 15:
From adagilson@linux.local Fri Sep 19 21:29:01 2003 Date: Fri, 19 Sep 2003 21:29:00 -0300 From: root@linux.local (Cron Daemon) To: adagilson@linux.local Subject: Cron
xmms -p /home/adagilson/acordar.m3u X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env:
/bin/sh: xmms: command not found Thanks for any help a. John Pettigrew escreveu:
In a previous message, Evan Morris wrote:
30 14 * * * root /usr/bin/perl /home/default/scriptname.pl some_argument
[snip]
Basically, I want to know how to tell the system to run a specific perl script at a certain time, and to accept a command line argument.
The first thing is to ensure that you have the command format correct - that is, if you type it into a console, does it do what you want? Once you have that format, just transfer the command into your crontab. The time/date and user fields are correct in the example you gave AFAIK.
If you want easier control of cron jobs, try webmin - it has a module for crons that makes it easier to manage. I discovered this tool recently and it's fantastic, with modules for configuring loads of different aspects of your system.>>
HTH John ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/
On Friday 19 September 2003 23:50, wrote:
I put this line into my crontab: 29 21 * * * xmms -p /home/adagilson/acordar.m3u
Although, the command line: xmms -p /home/adagilson/acordar.m3u ...can play a list of mp3 very fine when executed by a Gnome terminal, it is not working with Cron. Take a look at the result from the command CRONTAB -L: $crontab -l #vi crontab 29 21 * * * xmms -p /home/adagilson/acordar.m3u
:wq!#You have new mail in /var/spool/mail/adagilson
This is the MESSAGE SENT BY CRON: Message 15: From adagilson@linux.local Fri Sep 19 21:29:01 2003 Date: Fri, 19 Sep 2003 21:29:00 -0300 From: root@linux.local (Cron Daemon) To: adagilson@linux.local Subject: Cron
xmms -p /home/adagilson/acordar.m3u X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: /bin/sh: xmms: command not found
Provide the fullpath to xmms. Depending on the user that Crontab executes xmms as, it may not be in it's path. Probably, crontab doesn't have a $PATH var. /usr/bin/xmms in place of plain xmms should work -- The Meek shall inherit the Earth, for the Brave are among the Stars!
So, I did what you suggested and no cron messages are being sent to me, but it still doesn't play any sound at scheduled time. Take a look at CRONTAB -L command: $crontab -l #vi crontab 29 21 * * * xmms -p /home/adagilson/acordar.m3u :wq!# Does crontab understand all bash commands? Any more ideas? Thanks for helping a. Daniel Joyce escreveu:
On Friday 19 September 2003 23:50, wrote:
I put this line into my crontab: 29 21 * * * xmms -p /home/adagilson/acordar.m3u
Although, the command line: xmms -p /home/adagilson/acordar.m3u ...can play a list of mp3 very fine when executed by a Gnome terminal, it is not working with Cron. Take a look at the result from the command CRONTAB -L: $crontab -l #vi crontab 29 21 * * * xmms -p /home/adagilson/acordar.m3u
:wq!#You have new mail in /var/spool/mail/adagilson
This is the MESSAGE SENT BY CRON: Message 15: From adagilson@linux.local Fri Sep 19 21:29:01 2003 Date: Fri, 19 Sep 2003 21:29:00 -0300 From: root@linux.local (Cron Daemon) To: adagilson@linux.local Subject: Cron
xmms -p /home/adagilson/acordar.m3u X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: /bin/sh: xmms: command not found
Provide the fullpath to xmms. Depending on the user that Crontab executes xmms as, it may not be in it's path. Probably, crontab doesn't have a $PATH var.
/usr/bin/xmms in place of plain xmms should work
On Tuesday 23 Sep 2003 2:27 pm, Adagilson Batista Bispo da Silva wrote:
So, I did what you suggested and no cron messages are being sent to me, but it still doesn't play any sound at scheduled time. Take a look at CRONTAB -L command:
$crontab -l #vi crontab 29 21 * * * xmms -p /home/adagilson/acordar.m3u
:wq!#
Does crontab understand all bash commands? Any more ideas? Thanks for helping a.
Daniel Joyce escreveu:
On Friday 19 September 2003 23:50, wrote:
I put this line into my crontab: 29 21 * * * xmms -p /home/adagilson/acordar.m3u
Although, the command line: xmms -p /home/adagilson/acordar.m3u ...can play a list of mp3 very fine when executed by a Gnome terminal, it is not working with Cron. Take a look at the result from the command CRONTAB -L: $crontab -l #vi crontab 29 21 * * * xmms -p /home/adagilson/acordar.m3u
:wq!#You have new mail in /var/spool/mail/adagilson
This is the MESSAGE SENT BY CRON: Message 15: From adagilson@linux.local Fri Sep 19 21:29:01 2003 Date: Fri, 19 Sep 2003 21:29:00 -0300 From: root@linux.local (Cron Daemon) To: adagilson@linux.local Subject: Cron
xmms -p /home/adagilson/acordar.m3u X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: /bin/sh: xmms: command not found
Provide the fullpath to xmms. Depending on the user that Crontab executes xmms as, it may not be in it's path. Probably, crontab doesn't have a $PATH var.
/usr/bin/xmms in place of plain xmms should work
Just out of curiosity I tried it and it doesn't work. I put it to my colleague who seems to think that it fails because cron needs to activate the xserver which it is unable to do. So if there is a way to get cron to run x apps then I guess it will work. Perhaps someone else may be able to chip in and provide the missing link. Eddie
On Tuesday 23 September 2003 15:57, eddie wrote:
Just out of curiosity I tried it and it doesn't work. I put it to my colleague who seems to think that it fails because cron needs to activate the xserver which it is unable to do. So if there is a way to get cron to run x apps then I guess it will work.
Perhaps someone else may be able to chip in and provide the missing link.
It needs to access an X server, yes. If there is one running, make sure the cron job is started as the user that runs the X server, and that the environment variable DISPLAY is set correctly for cron. If there isn't one running you need to start one. If it's a headless box you could consider running the X virtual frame buffer. The same considerations for the running user and the DISPLAY variable apply
eddie wrote:
Perhaps someone else may be able to chip in and provide the missing link.
It won't work, I can't give a short explanation why. Try using mpg123 or mpg321 and suppress the output if mpg123/321 have an option for that.
participants (6)
-
Adagilson Batista Bispo da Silva
-
adagilson@cpqam.fiocruz.br
-
Anders Johansson
-
Daniel Joyce
-
eddie
-
Silviu Marin-Caea