LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-21-2008, 06:02 AM   #1
neiro
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Rep: Reputation: 0
How to start X-based application through bash script + CRON ?


Hi!

I have a some problem.

My system:
Ubuntu Server Ubuntu 8.04.1 + xfce4 (It's a test machine)


I make a simple script, such as:
Quote:
#!/bin/bash

vlc /home/user/test.avi &
After the make, a change attributes to execute
Quote:
chmod +x ./some.script.sh
This script work fine if manualy execute from xterm, but I wanna to start this script from /etc/crontab file, but it's don't work

Sorry for my bad english!
Thanks 4 all!

Last edited by neiro; 07-21-2008 at 06:15 AM.
 
Old 07-21-2008, 08:28 AM   #2
neiro
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Run X-based application

Thanks for All

First! run a command to verify your default display sets:

Quote:
env |grep DISPLAY
Secondly, add to /etc/crontab this string:

Quote:
minutes hour * * * username_not_root export DISPLAY=:0 && /bin/bash ~/some_script.sh > /dev/null
In this form, shell-script work fine!
Enjoy!
 
Old 07-21-2008, 06:53 PM   #3
FranDango
Member
 
Registered: Jun 2008
Posts: 101

Rep: Reputation: 15
What is the purpose of running a media player as a cron job? Is this some attempt to surprise a fellow worker with some video footage during work and confuse the poor guy completely? Will be quite annoying after the first few viewings.

Linux Archive

Last edited by FranDango; 09-20-2008 at 06:49 AM.
 
Old 07-22-2008, 01:57 AM   #4
neiro
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Talking

Quote:
Originally Posted by FranDango View Post
What is the purpose of running a media player as a cron job? Is this some attempt to surprise a fellow worker with some video footage during work and confuse the poor guy completely? Will be quite annoying after the first few viewings.
Nice Joke!

I need to run the media player with new playlist file every day. It's need for network & local video translating in my case.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start and stop a bash script based on network activity? creativetweak Linux - Software 8 05-04-2008 11:28 PM
help: using cron + my bash script --> don't want mail from script beeblequix Linux - General 7 11-23-2007 10:25 PM
using cron to start and stop a bash script monty Linux - Software 2 03-20-2006 03:30 PM
bash script from cron kubla Programming 3 01-22-2004 05:30 AM
cron script to verify application is running? Llwyd Linux - General 4 12-20-2002 07:52 PM


All times are GMT -5. The time now is 06:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration