This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to launch Ktorrent with cron ?

Tags: None
(comma "," separated)
pirouette
Registered Member
Posts
2
Karma
0

How to launch Ktorrent with cron ?

Fri Nov 27, 2009 2:42 pm
Hi,

I'm using ktorrent 3.3.1 with Debian (kde 4.3.2).

When Ktorrent crash I would like to restart it with a simple cron script (bash):

Code: Select all
#!/bin/bash
ps x|grep ktorrent > /home/pascal/tmp/process
if grep "/usr/bin/ktorrent" /home/pascal/tmp/process ; then
        echo ""
        else
                `/usr/bin/ktorrent`
fi

If I run this script by hand, it works fine. But with cron I get this error message:
<unknown program name>(26029)/: KUniqueApplication: Cannot find the D-Bus session server: "/usr/bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.

Is there a way to fix that ?

Pirouette
pirouette
Registered Member
Posts
2
Karma
0
Hi,

The answer to my question is:
Code: Select all
#!/bin/bash
ps x|grep ktorrent > /home/pascal/tmp/process
if grep "/usr/bin/ktorrent" /home/pascal/tmp/process ; then
        echo ""
        else
                export DISPLAY=:0 && `/usr/bin/ktorrent --nocrashhandler`
fi


Pirouette


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft