LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-22-2008, 11:08 AM   #1
gocool_fedora
LQ Newbie
 
Registered: Dec 2008
Posts: 6
Blog Entries: 1

Rep: Reputation: 0
Cron job error


Hi friends...I tried to play a media file by scheduling a cron job......it says the following error...can any one decode and tell the problem........

From gokul@localhost.localdomain Mon Dec 22 12:14:02 2008
Return-Path: <gokul@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.14.1/8.14.1) with ESMTP id mBM6i2IG025668
for <gokul@localhost.localdomain>; Mon, 22 Dec 2008 12:14:02 +0530
Received: (from gokul@localhost)
by localhost.localdomain (8.14.1/8.14.1/Submit) id mBM6i1YR025667;
Mon, 22 Dec 2008 12:14:01 +0530
Message-Id: <200812220644.mBM6i1YR025667@localhost.localdomain>
From: root@localhost.localdomain (Cron Daemon)
To: gokul@localhost.localdomain
Subject: Cron <gokul@localhost> realplay /media/BACKUP/Yuvraj/02 Track 2.mp3
Date: Mon, 22 Dec 2008 12:14:01 0530 (IST)
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/gokul>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=gokul>
X-Cron-Env: <USER=gokul>


** ERROR **: Unable to open display
aborting...
/usr/bin/realplay: line 57: 25666 Aborted $HELIX_LIBS/realplay.bin "$@"
 
Old 12-22-2008, 11:24 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Crontab has a very limited environment and overall it does not allocate a display. You have to explicitly allocate it by assigning the DISPLAY environment variable, but this assumes you previously know which display number is active on your monitor (usually :0.0). For example a working cron job can be:
Code:
30 20 * * * /usr/bin/env DISPLAY=:0.0 /usr/bin/xclock
For more complex tasks you have to play with the xauth command.
 
Old 12-22-2008, 11:50 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You could use mpg123 or mplayer, it doesn't need X
mpg123 /media/BACKUP/Yuvraj/02 Track 2.mp3
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron job Extension /path/to/script not found error mts7 Linux - Server 7 03-20-2008 10:56 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron job no function no error wanghao Linux - Software 6 11-27-2007 06:01 PM
cron error: no job control schentor Linux - Software 2 07-18-2005 12:39 PM
cron job <defunct> error? existo Slackware 7 01-21-2004 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:42 PM.

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