You are not logged in.

#1 2011-06-28 06:37:11

kveras
Member
From: Uppsala, Sweden
Registered: 2011-03-22
Posts: 54

[SOLVED]Crontab fails to execute script

Good morning.

I have tried to setup crontab to give my ati card a different clockspeed depending on the time of day. I can't get it to work properly. This is what I have done.

I have 3 scripts in my ~/bin folder for 3 different clocks. This is one example, I call this upclock.sh.

#!/bin/bash
export DISPLAY=:0
/usr/bin/aticonfig --odsc 895,300

If I execute it from the commandline, as a normal user, it works as expected and the clock is changed. This goes for all 3 scripts.

I add these to roots crontab like this:

15 23 * * * `DISPLAY=:0 /home/johan/bin/downclock.sh`
0 3 * * * `DISPLAY=:0 /home/johan/bin/midclock.sh`
0 7 * * * `DISPLAY=:0 /home/johan/bin/upclock.sh`

But, I get the following error mail when the times specified comes:

No protocol specified
/bin/sh: ERROR: command not found

Anyone got a hint on what to do to make it work? I have tried to remove the "DISPLAY=:0", with the same result.

Last edited by kveras (2011-06-28 12:40:14)

Offline

#2 2011-06-28 06:41:41

kveras
Member
From: Uppsala, Sweden
Registered: 2011-03-22
Posts: 54

Re: [SOLVED]Crontab fails to execute script

Btw, I get this "No protocol specified" a lot after random commands.

Offline

#3 2011-06-28 07:10:34

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,238
Website

Re: [SOLVED]Crontab fails to execute script

15 23 * * * `DISPLAY=:0 /home/johan/bin/downclock.sh`
0 3 * * * `DISPLAY=:0 /home/johan/bin/midclock.sh`
0 7 * * * `DISPLAY=:0 /home/johan/bin/upclock.sh`

You don't want to use backticks around your commands. Start by removing them.

Offline

#4 2011-06-28 07:35:37

kveras
Member
From: Uppsala, Sweden
Registered: 2011-03-22
Posts: 54

Re: [SOLVED]Crontab fails to execute script

fukawi2 wrote:
15 23 * * * `DISPLAY=:0 /home/johan/bin/downclock.sh`
0 3 * * * `DISPLAY=:0 /home/johan/bin/midclock.sh`
0 7 * * * `DISPLAY=:0 /home/johan/bin/upclock.sh`

You don't want to use backticks around your commands. Start by removing them.

Oh, I picked those up from a similar crontab on the gentoo forums, don't know why. I removed them and I now get another message.

No protocol specified
ERROR - X needs to be running to perform ATI Overdrive(TM) commands

However, X is running, initiated by SLIM as normal user "johan".

I tried using the user johan's crontab instead:

15 23 * * * DISPLAY=:0 /home/johan/bin/downclock.sh
0 3 * * * DISPLAY=:0 /home/johan/bin/midclock.sh
0 7 * * * DISPLAY=:0 /home/johan/bin/upclock.sh

This works just fine! smile

Thank you for pointing me in the right direction.

Offline

#5 2011-06-28 12:34:19

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]Crontab fails to execute script

please mark as solved.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB