Read the statement by Michael Teeuw here.
cron job hdmi on and off
-
I thought it was right but now the rights on the sh files are set to 0777 and also on the folders
I also did a test to see if I could execute the sh files, this works tonight the cron should execute it, let me know if it works
-
@Sam-0 yes. although you dont need write permission, (except for user)
means anyone else could change the script -
@Sam-0 said in cron job hdmi on and off:
i created two files
off.sh and on.sh
they contain the following lineswlr-randr --output HDMI-A-1 --off
wlr-randr --output HDMI-A-1 --onDo you have
#!/bin/bashor#!/bin/shat the very beginning of your shell scripts ?#! /bin/sh – Execute the file using the Bourne shell, or a compatible shell, assumed to be in the /bin directory
#! /bin/bash – Execute the file using the Bash shellYou can also put
/bin/bashin the crontab entry (before/home/username/...).
Then there is no way for cron to not execute it as a shell script and it will even run without the executable bit set.And what Sam mentioned: the scripts need to be executable but not necessarily writable (
chmod 755).
This should normally do the trick.If you have
mailinstalled (which mail) you can put this at the very beginning of the crontab file:
MAILTO=username(in my caseadmin).
With
journalctl --since "1 day ago" --unit cron.service --no-pager
you can see if cron ran your script and withmailyou can see more details on the cron job executed.Good luck.
-
@evroom Thanks for your explanation, I have made adjustments and will check tonight if it works. I will report this back. Thanks for the effort.
-
unfortunately it still doesn’t work what am I doing
wrong?!

cron infoon sh file

off sh file

error logfile:

-
So it seems that the cronjob is okay.
Can you do:
ˋˋˋls -als /run/user/1000/wayland*ˋˋˋI think you need wayland-0 iso wayland-1.
With ˋˋˋ grep username /etc/passwdˋˋˋ (use your username) you can verify that your user has uid 1000.
-
In de laatste 2 regels mist een spatie bij /home.
-
This post is deleted! -
ok i checked some more and did some tests

when I execute the following I get the error message that I also see in the log
/usr/bin/wlr-randr --output H DMI-A-1 --off
failed to connect to displayalso running the sh files via putty gives the error
it seems that the command:
/usr/bin/wlr-randr --output H DMI-A-1 --off
the error message gives the question is this command incorrect or is there an underlying problem?
-
@Sam-0 Can you run the following from the command line and she your results:
wlr-randr
ls -als /run/user/1000/wayland*Share your results. Either the
wayland-1is different as indicated by @evroom orHDMI-A-1is actually a different version on your system.Share the results from the above and we take it from there. Also, @evroom has indicated the there is supposed to be a space before
/homeon the crontab.
