Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to set a cron job to run every minute. I have a script in a directory in my home directory. Inside the script is:

#!/bin/bash

/usr/bin/xgamma -gamma 2.0

I actually prefer 0.65, but I'm using 2.0 to make sure the script actually runs (it does not).

The cron job is

* * * * * /home/myuser/scripts/gamma

I am doing this because I've noticed that on boot, resume from hibernate/suspend, and I feel like at least a few random times, xgamma seems to revert to 1.0. I want this script to automatically run and fix it.

What else I've tried..

For the cron job:

* * * * * /home/myuser/scripts/gamma &
* * * * * xgamma -gamma 2.0
* * * * * /usr/bin/xgamma -gamma 2.0
* * * * * bash -c "xgamma -gamma 2.0"
* * * * * xgamma -gamma > /home/myuser/scripts/gtest.log

Trying to write to the log produced no results. It remained empty, even after I created the file by hand and even after I set it to 777.

For the script shebang:

#!bin/sh

For the script body:

xgamma -gamma 2.0
Adding the entire PATH variable line from env before the rest of the script but after the shebang

I also added this to my ~/.profile, and ran it from the command line as well after adding it:

xhost +local:

So far, I have achieved nothing. Not one thing has produced anything other than messages in the syslog that the commands are running, stuff like:

Jun 17 13:15:01 mymachine CRON[3220]: (myuser) CMD (/usr/bin/xgamma -gamma 2.0)
Jun 17 13:23:01 mymachine CRON[3408]: (myuser) CMD (/home/myuser/scripts/gamma &)

But nothing has actually produced any results other than that. No errors or anything, just syslog messages.

Additionally, if I do

./gamma

From the CLI, it runs the script perfectly.

I have newlines after the jobs in crontab.

So... what am I doing wrong?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.