You are not logged in.

#1 2004-10-20 14:38:02

Mith
Member
From: out there
Registered: 2004-10-05
Posts: 163

crontab question/problem [solved]

Hi,
first: Did I just not find it or is there no forum part where my crontab question would fit better than into the Workstation User part?
Maybe the captions to the forum parts should be reconsidered.
Anyway,
my problem is. I want to kill a program and start it again right away.
my crontab looks the following

# Ksmoothdock beenden
* * * * *       killall ksmoothdock
# Ksmoothdock starten
* * * * *       /bin/ksmoothdock

thing is, my wallpaper changes every other minute and ksmoothdock is sort of semi transparent, i.e. when you start it, it takes the background as it's own background but when my background changes ksmoothdock stays the same so it looks sort of stupid smile
killall ksmoothdock works like a charm, I just don't seem to be able to start it..
any idea?


ArchLinux (x86_64) w/ kdemod

Offline

#2 2004-10-20 18:22:26

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: crontab question/problem [solved]

Are you sure your ksmoothdock is installed in /bin ? Maybe it's in /usr/bin or /opt/kde.....somewhere.

Offline

#3 2004-10-20 21:43:17

Mith
Member
From: out there
Registered: 2004-10-05
Posts: 163

Re: crontab question/problem [solved]

mith@middleearth|[~]:~ > whereis ksmoothdock
ksmoothdock: /bin/ksmoothdock

ArchLinux (x86_64) w/ kdemod

Offline

#4 2004-10-20 22:29:15

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: crontab question/problem [solved]

hmm..likely half the time it is being killed as it is being started.lol

I would recommend makin a shell script to do it, and crontabbing your shell script.
ie.

#!/bin/bash
####script located at ~/bin/fixdock
killall ksmoothdock
/bin/ksmoothdock &


then making your crontab:
* * * * * ~/bin/fixdock > /dev/null 2>&1

That restarts it every minute. Depending on which part of the minute the background changes (if they both change on the minute, you might end up with a race condition. If swoothdock restart completes before background rotation, well, then...your dock background will always be using the last rotation as a background. lol)


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2004-10-21 10:08:57

Mith
Member
From: out there
Registered: 2004-10-05
Posts: 163

Re: crontab question/problem [solved]

thx Cactus,
BUT  :twisted: .. the script is executed and ksmoothdock is killed but not started.. funny thing is. I added a "sleep 1" so there is a bit of a time difference between killing and starting.. running the script by hand it kills ksmoothdock and starts it again.. running it with crontab just kills and not restarts, now does that make any sense?


ArchLinux (x86_64) w/ kdemod

Offline

#6 2004-10-21 15:12:43

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: crontab question/problem [solved]

That just means that crontab doesn't set your DISPLAY variable.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#7 2004-10-22 08:33:57

Mith
Member
From: out there
Registered: 2004-10-05
Posts: 163

Re: crontab question/problem [solved]

Xentac wrote:

That just means that crontab doesn't set your DISPLAY variable.

That sounds good, but how can I fix this? Do you know that too?


ArchLinux (x86_64) w/ kdemod

Offline

#8 2004-10-22 08:44:45

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: crontab question/problem [solved]

#!/bin/bash
####script located at ~/bin/fixdock
export DISPLAY=":0.0"
killall ksmoothdock
/bin/ksmoothdock &



try that.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#9 2004-10-22 10:14:59

Mith
Member
From: out there
Registered: 2004-10-05
Posts: 163

Re: crontab question/problem [solved]

cactus wrote:

#!/bin/bash
####script located at ~/bin/fixdock
export DISPLAY=":0.0"
killall ksmoothdock
/bin/ksmoothdock &
try that.

thank you very much. Now it works!
:twisted:


ArchLinux (x86_64) w/ kdemod

Offline

#10 2004-10-22 17:38:21

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: crontab question/problem [solved]

8)


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

Board footer

Powered by FluxBB