Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Incorrect executing of a croned script
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
fragment
n00b
n00b


Joined: 08 Mar 2013
Posts: 26

PostPosted: Mon Jul 29, 2013 11:29 am    Post subject: [solved] Incorrect executing of a croned script Reply with quote

I wrote an elementary script for a restarting Conky and put this to the KCron for executing every half an hour.

Code:

locus ~ # cat /var/spool/cron/crontabs/frag
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/kde-frag/systemsettingsW23182.tmp installed on Mon Jul 29 14:07:00 2013)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
#No comment
*/30 * * * *    /home/frag/.scripts/for_conky.sh


# File generated by KCron the Monday, July 29, 2013 02:07 PM.


The script:
Code:

locus ~ # cat /home/frag/.scripts/for_conky.sh
#!/bin/bash

killall conky
conky &

exit 0


When I'm clicking on script in Dolphin, Conky is restarting normally, but when the script is being executed with KCron, Conky is being killed only and not being launched.
How to fix it?


Last edited by fragment on Tue Jul 30, 2013 3:29 am; edited 1 time in total
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Tue Jul 30, 2013 2:26 am    Post subject: Reply with quote

Instead of
Code:
conky &

try
Code:
conky -d

_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
fragment
n00b
n00b


Joined: 08 Mar 2013
Posts: 26

PostPosted: Tue Jul 30, 2013 3:13 am    Post subject: Reply with quote

BoneKracker wrote:
Instead of
Code:
conky &

try
Code:
conky -d


Thank you! The problem solved!
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Tue Jul 30, 2013 3:21 am    Post subject: Reply with quote

Do you understand why?
_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
fragment
n00b
n00b


Joined: 08 Mar 2013
Posts: 26

PostPosted: Tue Jul 30, 2013 3:28 am    Post subject: Reply with quote

BoneKracker wrote:
Do you understand why?


Yes, I read man conky :)
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Tue Jul 30, 2013 3:33 am    Post subject: Reply with quote

Good. And do you understand why
Code:
conky &

works from the terminal but not when you run it from cron?
_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum