Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: How to use Cron ?, How to use Cron ?< Next Oldest | Next Newest >
manishsadh Offline





Group: Members
Posts: 42
Joined: Jan. 2007
Posted: April 03 2007,14:23 QUOTE

Hi Folks,

my system - dsl 3.2 frugal

need some help with running cron.
i edited the /etc/crontab file and
added the following

0 10 * * * * /home/dsl/xx.sh

then i ran the MyCron from system -> control panel.
at 10 am the scheduled script didnt run.

what i am i missing ? is there a specific cron howto for dsl ?

thanks.
Back to top
Profile PM 
robc Offline





Group: Members
Posts: 24
Joined: Jan. 2007
Posted: April 04 2007,16:47 QUOTE

manishsadh, you can have cron output to a file, including errors, to view. To do this use the following line in your crontab:
Code Sample
0 10 * * * * /home/dsl/xx.sh >> /path/to/output/file 2>&1

I am having trouble with cron also. It runs, but will not open gui applications. When I use the following line in the crontab:
Code Sample
* * * * * * beaver & >> /tmp/crontest 2>&1

The application does not open and I get this in nohup.out:
Quote
Gtk-WARNING **: cannot open display:

I get similar results for all gui applications that I try to open with cron. All the applications do run when I use Aterm or click on an icon.

Though they will run if I use the following line in crontab instead:
Code Sample
* * * * * * xterm -e beaver & >> /tmp/crontest 2>&1

but then I have an extra xterm window open that I don't want.

I'm not sure if this is a problem with gtk or with cron.

I also tryed using cron to start a script that would call a gui program and I got the same results. the script would run, but the application I wanted to start did not.

Does anyone know of a fix for this or have any guidance for this situation?

Thanks
Rob
Back to top
Profile PM 
jimmit Offline





Group: Members
Posts: 3
Joined: Feb. 2007
Posted: April 11 2007,22:12 QUOTE

I was having the same problem.

I had a shell script that used xset to turn the screen off.  I had to launch the script with /bin/bash instead of sh and I had to add "export DISPLAY=:0" to the beginning of my shell script.

In your case you may want to create a script such as this...
Code Sample
#!bin/bash
export DISPLAY=:0
beaver &


I hope that helps!
-James
Back to top
Profile PM 
robc Offline





Group: Members
Posts: 24
Joined: Jan. 2007
Posted: April 12 2007,14:38 QUOTE

jimmit,

I added the export line to my script and now it works with cron.  :)

Thank you for the tip.


Rob
Back to top
Profile PM 
3 replies since April 03 2007,14:23 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: How to use Cron ?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code