[crontab][not-working]command='redshift':

D

Deleted member 107511

Guest
Hello,
I use a dummy script at '/bin/rdshft.bash' for a single shot applying of 'redshift' command with its options, the content of the command 'rdshft.bash' is:
Code:
#!/bin/bash
redshift -v -P -l 28.00:78.00 -t 3200:2400
So, yesterday I decided to add the 'rdshft.bash' to the crontab for automatic execution at boot, as follows:
Code:
@reboot /bin/sleep 24 && /bin/rdshft.bash
, but did not work, even after trying a few times, then I made it a bit simple:
Code:
@reboot /bin/rdshft.bash
, but still it did not work.
It would be very helpful if someone help me out...
Thanking you...
 
Last edited by a moderator:


Double check your $PATH.

I had a similar problem with a script that wouldn't run in cron. Turns out that cron wasn't looking in /home/<myhome>/bin, which is where the script lived. So I needed to add something like ...
Code:
$PATH=$PATH:/home/<myhome>/bin
... to my crontab and it was off to the races!

No guarantee that I got the syntax 100% right, but a quick search should take care of that.

Hope that solves your issue.
 
Nope. I should read more carefully. You put your script in /bin, and if your $PATH doesn't point there, you've got bigger problems.

I'm not too familiar with redshift, but does it work on the GUI? That is, if you never booted into a graphical environment, would redshift do anything? Because launching it from within cron @reboot is launching it in a non-graphical environment and I get the impression that it may need to start up after you've started X.

Hope that helps.
 
Nope. I should read more carefully. You put your script in /bin, and if your $PATH doesn't point there, you've got bigger problems.

I'm not too familiar with redshift, but does it work on the GUI? That is, if you never booted into a graphical environment, would redshift do anything? Because launching it from within cron @reboot is launching it in a non-graphical environment and I get the impression that it may need to start up after you've started X.

Hope that helps.
First of all, Thanking you for this very useful info.(actually caution for future),
but my
Code:
echo $PATH
results in:
'/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games', which contains '/bin'.

I'm not too familiar with redshift, but does it work on the GUI? That is, if you never booted into a graphical environment, would redshift do anything? Because launching it from within cron @reboot is launching it in a non-graphical environment and I get the impression that it may need to start up after you've started X.
You are very right, but ubuntu easily loads the GUI in 24 seconds, that too in tty_#7(^M-F7) meaning its normal GUI.
 

Members online


Top