You are not logged in.
Pages: 1
Hello,
I am trying to use crontab to set up night light to run at certain time. However, when I tried to test it, I couldn't get it running as expected. Here are the cron files that I tried to use:
Option 1: Tell cron to run xrandr command every minute:
* * * * * xrandr --output DP-2 --gamma 1.0:0.88:0.76 --brightness 0.5 Option 2: Tell cron to run script for every minute instead (by following an example from Arch wiki - cron https://wiki.archlinux.org/title/cron#R … lications)
* * * * * /home/user_name/Documents/07.sh I tried both of these but they do not seems to work. And yes, the 07.sh has the
#!/bin/bash to make sure the script can communicate with terminal and it is an executable file (when I double click it does change the gamma and brightness as expected).
Would love to get some help here. Thanks!
Offline
please post the complete files and also tell us in what file exactly, you put those lines. Did you put in in /etc/crontab? If yes, I am missing the user that is supposed to run the command.
Is your file executable? (chmod +x)
# m h dom mon dow user commanda valid cronfile could look like this:
cat /etc/cron.d/0hourly
# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
01 * * * * root run-parts /etc/cron.hourlyOffline
And is there any reason you need to use cron rather than a systemd timer?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
And is there any reason you need to use cron rather than a systemd timer?
I was told to use cron as a way to automate that. But I will look into systemd timer as another option to deal with.
Offline
please post the complete files and also tell us in what file exactly, you put those lines. Did you put in in /etc/crontab? If yes, I am missing the user that is supposed to run the command.
Is your file executable? (chmod +x)# m h dom mon dow user commanda valid cronfile could look like this:
cat /etc/cron.d/0hourly# Run the hourly jobs SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root 01 * * * * root run-parts /etc/cron.hourly
I think I missed some headers in the cron file. I will let you know when I modified that.
Offline
I was told to use cron...
By whom? Someone using a system that uses cron by default and not systemd? That advice would not apply to archlinux.
You certainly can run cron on arch, and some people do. But that's a deliberate choice because they have specific reasons (or perhaps just prejudices) to prefer it to systemd timers.
If you were not already using cron and added it just for this, then that's definitely the wrong approach. A systemd timer would be the proper approach for an archlinux system.
Note that this would likely be a systemd --user timer.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
https://archlinux.org/packages/extra/x86_64/redshift/ exists …
As for cron'ning xrandr, you'll have to export at least the DISPLAY
Offline
Pages: 1