LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Script doesn't execute in crontab (https://www.linuxquestions.org/questions/linux-general-1/script-doesnt-execute-in-crontab-574646/)

jis0501 08-04-2007 01:34 AM

Script doesn't execute in crontab
 
Hi Gurus,

I am Linux newbie. I tried to run the following script in crontab with no success. However, it works in xterm. Could you please give me some advice?

#!/bin/sh
DISPLAY=0.0
/usr/bin/xterm -display :0 -e \
/usr/bin/gmplayer -fs -zoom -quiet -vo xv %s \
-cache 8192 -cache-min 80 -msglevel all=-1 \
-nolirc -ontop -playlist /home/cool2/PlayList/playlist.txt

24 18 * * * cool2 /home/cool2/play-music.sh

Regards,

jis0501

SCerovec 08-04-2007 04:00 AM

In crontab, the script is executed in a totally different environment than from xterm.
For practice, make a script that exports the environment to a logfile.
refer to bash's manpage for how to do this ;)

OTOH root ain't supposed to have access to X, as it's a security hole ;)

XavierP 08-04-2007 07:09 AM

Moved: This thread is more suitable in Linux-General and has been moved accordingly to help your thread/question get the exposure it deserves.


All times are GMT -5. The time now is 03:31 AM.