Debian stretch user here. I wanted a screen flash every ten minutes. After trying a couple of alternatives (includeing xrefresh
) I decided to use sct
. It works in shell but does not work with cron
.
This works:
sct 2000
The script: (named colrefr
)
#!/bin/bash
PATH=/usr/bin
sct 2000; sleep 3; sct
Cron: (pgrep cron
shows cron
is running)
* * * * * /home/user/folder/colrefr
(once every minute until debugging is successful)
I have mitigated the usual gotchas - newline after last command, setting PATH
in the script, no dots in file name, etcetera.
$ which sct
/usr/bin/sct
$ which sleep
/bin/sleep/
-
$ sudo tail -f /var/log/syslog
Oct 16 16:00:01 user CRON[29060]: (user) CMD (/home/user/folder/colrefr )
Oct 16 16:00:01 user kernel: [229206.201351] sct[29062]: segfault at e0 ip 000055dca79aa8cd sp 00007ffd9dfc6220 error 4 in sct[55dca79aa000+2000]
Oct 16 16:00:01 user kernel: [229206.201366] Code: 17 20 00 66 90 ff 25 4a 17 20 00 66 90 41 57 41 56 41 55 41 54 55 53 89 fb 31 ff 48 89 f5 48 83 ec 38 e8 ae ff ff ff 49 89 c4 <48> 63 80 e0 00 00 00 4c 89 e7 48 c1 e0 07 49 03 84 24 e8 00 00 00
Oct 16 16:00:01 user kernel: [229206.209280] sct[29064]: segfault at e0 ip 000055dcdd3268cd sp 00007ffdf60c9e40 error 4 in sct[55dcdd326000+2000]
Oct 16 16:00:01 user kernel: [229206.209295] Code: 17 20 00 66 90 ff 25 4a 17 20 00 66 90 41 57 41 56 41 55 41 54 55 53 89 fb 31 ff 48 89 f5 48 83 ec 38 e8 ae ff ff ff 49 89 c4 <48> 63 80 e0 00 00 00 4c 89 e7 48 c1 e0 07 49 03 84 24 e8 00 00 00
I have three other cronjobs
and they all work.
It runs without a hitch in shell.