You are not logged in.

#1 2011-05-22 16:04:20

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Cron doesn't do its job

Installed dcron, added "crond" to /etc/rc.conf autorun, edited "crontab -e" and saved

*/2 * * * * gcalctool

there but gcalctool is not started. Should be every 2 minutes...
What is wrong here?

Offline

#2 2011-05-22 17:05:00

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Cron doesn't do its job

For some reason "crontab -e" saves my config in "/tmp/crontab.F9VmyJ". Is this the problem?

Offline

#3 2011-05-22 17:11:03

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Cron doesn't do its job

crontab -e opens a temporary file which is rotated into place of the real crontab file after editing.

In this particular case, gcalctool runs in an environment that doesn't know of your X session. I assure you it's running (and failing) every 2 minutes. It needs to know about your display as well as have authorization to access it.

Offline

#4 2011-05-22 17:11:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Cron doesn't do its job

Have you started crond?

Offline

#5 2011-05-22 17:15:13

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: Cron doesn't do its job

You need to set DISPLAY to get X programs to work.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#6 2011-05-22 17:34:13

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Cron doesn't do its job

My config is:

*/1 * * * * kill `ps fax | grep 'kdeinit4' | awk -- '{print $1}'`

I watch kdeinit4 processes via htop and they are not being killed every minute. Although if I perform this command manually - kdeinit4 is killed.

Offline

#7 2011-05-22 17:38:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Cron doesn't do its job

Mr. Alex wrote:

My config is:

*/1 * * * * kill `ps fax | grep 'kdeinit4' | awk -- '{print $1}'`

I watch kdeinit4 processes via htop and they are not being killed every minute. Although if I perform this command manually - kdeinit4 is killed.

Maybe it needs a terminal to run in - try 'pkill kdeinit4' instead.

Edit: https://bugs.archlinux.org/task/18352

Edit 2: I've tested it with sxiv instead of kdeinit4 - works. Your method will produce at least two hits - one is the kdeinit4 you want to kill, the other is that search, as it has 'kdeinit4' in it:

[karol@black ~]$ ps fax | grep 'sxiv'
 3017 pts/0    S+     0:00  |       \_ grep sxiv
 3015 pts/4    S+     0:00          \_ sxiv pics/lego/4217246892_c520177c47_o.jpg

If you try to kill the first one you get

[karol@black ~]$ kill 3017
bash: kill: (3017) - No such process

because it already finished.

Last edited by karol (2011-05-22 18:07:06)

Offline

Board footer

Powered by FluxBB