LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to start X-based application throught bash script + CRON ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-start-x-based-application-throught-bash-script-cron-657118/)

neiro 07-21-2008 05:02 AM

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!

neiro 07-21-2008 07:28 AM

Run X-based application
 
Thanks for All :D

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! :)

FranDango 07-21-2008 05:53 PM

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

neiro 07-22-2008 12:57 AM

Quote:

Originally Posted by FranDango (Post 3222015)
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.


All times are GMT -5. The time now is 01:26 AM.