After spending a couple weeks on and off with this, it’s time for some help.
I’ve searched and tried everything I can find to get this to work which should be easy,
but starting to be a colossal pain.
I have a simple bash script, it is executable, and set to run every minute
It is because you are trying to have the cron run notify-send. You need some special handling so it knows how to do it. You probably need to set the DISPLAY variable at the very least. You could try something like this:
I agree with that. A long time ago, even before Yoda, my Unix mentor taught me this:
When writing a script, always use the full path name of a file you are referencing. Never use relative path names, that causes too many problems. Relative path names are OK with CLI commands, but not scripting.
OK that is my Linux tip for the day. I’ll shut up now.
Ok, I’ve forgon using a script for the moment and just put /usr/bin/notify-send "test"
in the command line in the task scheduler and set it to run every minute.
It does not work by using the timing configuration ,
It only works if you click run now.
Now I’m guessing something is amiss and not sure
what to do other than reinstall kcron.
I’m using kde on my server.
I’d like to use kcron/Task Scheduler to restart certain services and send me emails on certain events using scripts.
Why am I running something every minute?
Answer- To get something to work at all for testing…If it’s not going to work in 60 seconds, it’s not going to work when I set a real time for it to do anything.
As far as notify-send goes, it’s and action that’s easy to do and see if it’s working.
systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES >
Mon 2020-07-20 00:00:00 CEST 2h 10min left Mon 2020-07-13 17:49:05 CEST 6 days ago fstrim.timer fstrim.service >
Mon 2020-07-20 00:00:00 CEST 2h 10min left Sun 2020-07-19 18:20:13 CEST 3h 29min ago logrotate.timer logrotate.servic>
Mon 2020-07-20 00:00:00 CEST 2h 10min left Sun 2020-07-19 18:20:13 CEST 3h 29min ago man-db.timer man-db.service >
Mon 2020-07-20 00:00:00 CEST 2h 10min left Sun 2020-07-19 18:20:13 CEST 3h 29min ago shadow.timer shadow.service >
Mon 2020-07-20 00:00:00 CEST 2h 10min left Sun 2020-07-19 18:20:13 CEST 3h 29min ago updatedb.timer updatedb.service>
Mon 2020-07-20 18:35:32 CEST 20h left Sun 2020-07-19 18:35:32 CEST 3h 13min ago systemd-tmpfiles-clean.timer systemd-tmpfiles>
Sat 2020-08-01 15:00:00 CEST 1 weeks 5 days left Sat 2020-07-04 15:32:54 CEST 2 weeks 1 days ago pamac-cleancache.timer pamac-cleancache>
Mon 2020-08-03 01:39:09 CEST 2 weeks 0 days left Wed 2020-07-15 21:23:53 CEST 4 days ago btrfs-scrub@-.timer btrfs-scrub@-.se>
8 timers listed.
Pass --all to see loaded but inactive timers, too.
So if notify-send is not the essential part, then would you like to write (append) to a log file instead?
It is possible to monitor a log file with e.g. a terminal command
tail -f /path/to/logfile
Maybe that could work around this particular issue?
I did, The neat thing it does is put a little timer wheel on the close button,
However whatever is going on the script is still not being called by task manager.
I haven’t been following this, and don’t have Plasma (which I assume kcron comes from) - but can it be done by other means? cronie comes to mind - or a systemd timer…
cronie is installed, but disabled so idk whats running atm
BUT, as I sit here (ordered pizza), all the sudden I saw a log file show up.
Now it’s writing bash test into that log file, but it took forever to start working.
I enabled the notify command, so now I’ll see if it starts doing something in a bit.
I would think something like this is supposed to start working right away?