LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-04-2007, 01:34 AM   #1
jis0501
LQ Newbie
 
Registered: Aug 2007
Posts: 1

Rep: Reputation: 0
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
 
Old 08-04-2007, 04:00 AM   #2
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,471
Blog Entries: 2

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
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
 
Old 08-04-2007, 07:09 AM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

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


Reply

Tags
crontab


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script in crontab do not execute or take proper environment of user mayank_a Linux - Server 1 07-02-2007 05:03 AM
crontab : why root can't execute ?? bluenectar Linux - General 2 03-12-2007 03:21 AM
crontab execute consecutively SofNine Fedora 17 07-28-2006 01:34 PM
crontab entries will not execute when not logged fatra2 Linux - Software 2 05-23-2006 02:22 AM
Problem when using crontab to execute a .php file doublesheep Linux - General 3 06-10-2004 08:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration